mirror of
https://github.com/mastodon/mastodon.git
synced 2026-10-02 01:49:10 -05:00
Fix deleted-because-of-suspension accounts being marked as manually deleted (#40645)
This commit is contained in:
@@ -6,10 +6,10 @@ class Admin::AccountDeletionWorker
|
||||
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.week.to_i
|
||||
|
||||
def perform(account_id)
|
||||
delete_account = Account.find(account_id)
|
||||
return unless delete_account.unavailable?
|
||||
account = Account.find(account_id)
|
||||
return unless account.unavailable?
|
||||
|
||||
DeleteAccountService.new.call(delete_account, reserve_username: true, reserve_email: true)
|
||||
DeleteAccountService.new.call(account, reserve_username: true, reserve_email: true, suspended_at: account.suspended_at)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
true
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ RSpec.describe Admin::AccountDeletionWorker do
|
||||
allow(DeleteAccountService).to receive(:new).and_return(service)
|
||||
worker.perform(account.id)
|
||||
|
||||
expect(service).to have_received(:call).with(account, { reserve_email: true, reserve_username: true })
|
||||
expect(service).to have_received(:call).with(account, { reserve_email: true, reserve_username: true, suspended_at: account.reload.suspended_at })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user