mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 22:26:26 +08:00
FIX: Do not hide posts automatically when flagged by staff user
This commit is contained in:
parent
3c987132cb
commit
2818afb267
|
@ -613,6 +613,7 @@ class PostAction < ActiveRecord::Base
|
|||
elsif PostActionType.auto_action_flag_types.include?(post_action_type)
|
||||
|
||||
if acting_user.has_trust_level?(TrustLevel[4]) &&
|
||||
!acting_user.staff? &&
|
||||
post.user&.trust_level != TrustLevel[4]
|
||||
|
||||
hide_post!(post, post_action_type, Post.hidden_reasons[:flagged_by_tl4_user])
|
||||
|
|
|
@ -824,6 +824,12 @@ describe PostAction do
|
|||
|
||||
expect(post.hidden).to be_falsey
|
||||
|
||||
post = create_post(user: user)
|
||||
PostAction.act(Fabricate(:moderator), post, post_action_type)
|
||||
post.reload
|
||||
|
||||
expect(post.hidden).to be_falsey
|
||||
|
||||
user = Fabricate(:trust_level_4)
|
||||
post = create_post(user: user)
|
||||
PostAction.act(tl4_user, post, post_action_type)
|
||||
|
|
Loading…
Reference in New Issue
Block a user