add checks for staff and system user before sending flags_agreed_and_post_deleted message

This commit is contained in:
Neil Lalonde
2018-07-24 19:25:00 -04:00
parent 9516d3de4b
commit 417bcf7d2e
2 changed files with 21 additions and 2 deletions

View File

@@ -196,7 +196,7 @@ class PostDestroyer
end
def agree_with_flags
if @post.is_flagged?
if @post.is_flagged? && @user.id > 0 && @user.staff?
Jobs.enqueue(
:send_system_message,
user_id: @post.user.id,