Fix reports of already suspended accounts being recorded (#16047)

This commit is contained in:
Eugen Rochko 2021-04-16 22:01:05 +02:00 committed by Claire
parent 3799fd17ba
commit 4bd8dc09d8
2 changed files with 4 additions and 0 deletions

View file

@ -10,6 +10,8 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity
target_accounts.each do |target_account| target_accounts.each do |target_account|
target_statuses = target_statuses_by_account[target_account.id] target_statuses = target_statuses_by_account[target_account.id]
next if target_account.suspended?
ReportService.new.call( ReportService.new.call(
@account, @account,
target_account, target_account,

View file

@ -10,6 +10,8 @@ class ReportService < BaseService
@comment = options.delete(:comment) || '' @comment = options.delete(:comment) || ''
@options = options @options = options
raise ActiveRecord::RecordNotFound if @target_account.suspended?
create_report! create_report!
notify_staff! notify_staff!
forward_to_origin! if !@target_account.local? && ActiveModel::Type::Boolean.new.cast(@options[:forward]) forward_to_origin! if !@target_account.local? && ActiveModel::Type::Boolean.new.cast(@options[:forward])