Fix moderator account leak in status edit history (#17746)

lolsob-rspec
Eugen Rochko 2022-03-12 08:23:03 +01:00 committed by GitHub
parent 02d910cf90
commit cd06775130
1 changed files with 3 additions and 1 deletions

View File

@ -68,6 +68,8 @@ class Admin::StatusBatchAction
end
def handle_mark_as_sensitive!
representative_account = Account.representative
# Can't use a transaction here because UpdateStatusService queues
# Sidekiq jobs
statuses.includes(:media_attachments, :preview_cards).find_each do |status|
@ -76,7 +78,7 @@ class Admin::StatusBatchAction
authorize(status, :update?)
if target_account.local?
UpdateStatusService.new.call(status, current_account.id, sensitive: true)
UpdateStatusService.new.call(status, representative_account.id, sensitive: true)
else
status.update(sensitive: true)
end