Skip to content

Commit

Permalink
Only cast on posts where there were flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed Nov 16, 2018
1 parent 88cfde8 commit 1c7bcc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/deletion_log.rb
Expand Up @@ -31,7 +31,7 @@ class DeletionLog < ApplicationRecord
def self.auto_other_flag(dl = nil, post = nil)
return if post.nil? || !post.site&.auto_disputed_flags_enabled
deleted = dl.present? ? dl.is_deleted : !post.deleted_at.nil?
if deleted && (post.is_fp || post.is_naa)
if deleted && (post.is_fp || post.is_naa) && post.flag_logs.manual.successful.count > 0
comment_template = 'This post had {flags} spam flag(s) cast on it by Charcoal members and has since been deleted, but was ultimately judged '\
'not to have been spam. Please review whether spam flags - and the penalty that comes with them - are appropriate for this '\
'post - you can let us know in https://chat.stackexchange.com/rooms/11540 if the flags were inappropriate. '\
Expand All @@ -48,7 +48,8 @@ def self.auto_other_flag(dl = nil, post = nil)
backoff: status.present? ? message : 0,
site_id: post.site_id,
is_auto: true,
flag_type: 'other'
flag_type: 'other',
comment: comment
)
end
end
Expand Down

0 comments on commit 1c7bcc2

Please sign in to comment.