Fix deleted-because-of-suspension accounts being marked as manually deleted (#40645)

This commit is contained in:
Claire
2026-09-22 09:04:55 +00:00
parent 899f77836e
commit 79206902e9
2 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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