mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 09:51:24 +00:00
Use Account#targeted_reports
association where needed (#35249)
This commit is contained in:
parent
2cfa6cb0e0
commit
49db8a9662
|
@ -185,7 +185,7 @@ class Admin::AccountAction
|
||||||
@reports ||= if type == 'none'
|
@reports ||= if type == 'none'
|
||||||
with_report? ? [report] : []
|
with_report? ? [report] : []
|
||||||
else
|
else
|
||||||
Report.where(target_account: target_account).unresolved
|
target_account.targeted_reports.unresolved
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ class Form::AccountBatch
|
||||||
|
|
||||||
# Suspending a single account closes their associated reports, so
|
# Suspending a single account closes their associated reports, so
|
||||||
# mass-suspending would be consistent.
|
# mass-suspending would be consistent.
|
||||||
Report.where(target_account: account).unresolved.find_each do |report|
|
account.targeted_reports.unresolved.find_each do |report|
|
||||||
authorize(report, :update?)
|
authorize(report, :update?)
|
||||||
log_action(:resolve, report)
|
log_action(:resolve, report)
|
||||||
report.resolve!(current_account)
|
report.resolve!(current_account)
|
||||||
|
|
|
@ -297,7 +297,7 @@ class DeleteAccountService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def reported_status_ids
|
def reported_status_ids
|
||||||
@reported_status_ids ||= Report.where(target_account: @account).unresolved.pluck(:status_ids).flatten.uniq
|
@reported_status_ids ||= @account.targeted_reports.unresolved.pluck(:status_ids).flatten.uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
def associations_for_destruction
|
def associations_for_destruction
|
||||||
|
|
Loading…
Reference in New Issue
Block a user