mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Safefy: Updated Admin::AccountDeletionWorker to match AccountDeletionWorker (#37577)
This commit is contained in:
@@ -6,7 +6,10 @@ class Admin::AccountDeletionWorker
|
||||
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.week.to_i
|
||||
|
||||
def perform(account_id)
|
||||
DeleteAccountService.new.call(Account.find(account_id), reserve_username: true, reserve_email: true)
|
||||
delete_account = Account.find(account_id)
|
||||
return unless delete_account.unavailable?
|
||||
|
||||
DeleteAccountService.new.call(delete_account, reserve_username: true, reserve_email: true)
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
true
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ RSpec.describe Admin::AccountDeletionWorker do
|
||||
let(:worker) { described_class.new }
|
||||
|
||||
describe 'perform' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
let(:account) { Fabricate(:account, suspended: true) }
|
||||
let(:service) { instance_double(DeleteAccountService, call: true) }
|
||||
|
||||
it 'calls delete account service' do
|
||||
|
||||
Reference in New Issue
Block a user