FIX: Only apply post hide logic to flag actions

This commit is contained in:
Robin Ward 2019-09-18 09:38:36 -04:00
parent ab96239f2a
commit 7ae071282a

View File

@ -163,11 +163,11 @@ private
@post.user&.trust_level == TrustLevel[0]
@post.hide!(@post_action_type_id, Post.hidden_reasons[:flagged_by_tl3_user])
return
end
score = ReviewableFlaggedPost.find_by(target: @post)&.score || 0
if score >= Reviewable.score_required_to_hide_post
@post.hide!(@post_action_type_id)
elsif PostActionType.auto_action_flag_types.include?(@post_action_name)
score = ReviewableFlaggedPost.find_by(target: @post)&.score || 0
if score >= Reviewable.score_required_to_hide_post
@post.hide!(@post_action_type_id)
end
end
end