Skip to content

Commit 4bd8dc0

Browse files
GargronClearlyClaire
authored andcommitted
Fix reports of already suspended accounts being recorded (mastodon#16047)
1 parent 3799fd1 commit 4bd8dc0

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

app/lib/activitypub/activity/flag.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def perform
1010
target_accounts.each do |target_account|
1111
target_statuses = target_statuses_by_account[target_account.id]
1212

13+
next if target_account.suspended?
14+
1315
ReportService.new.call(
1416
@account,
1517
target_account,

app/services/report_service.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def call(source_account, target_account, options = {})
1010
@comment = options.delete(:comment) || ''
1111
@options = options
1212

13+
raise ActiveRecord::RecordNotFound if @target_account.suspended?
14+
1315
create_report!
1416
notify_staff!
1517
forward_to_origin! if !@target_account.local? && ActiveModel::Type::Boolean.new.cast(@options[:forward])

0 commit comments

Comments
 (0)