diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-02-07 01:14:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-07 01:14:44 +0100 |
commit | 9edefc779f8e5a5bdedd5a27f6fd815105dd3e92 (patch) | |
tree | 1e9199064f021464f52339d568b66495f32c696d /app/workers/scheduler | |
parent | 523a86618f8a1825e620a2461e465db3b4e1dc57 (diff) |
Fix `UserCleanupScheduler` crash when an unconfirmed account has a moderation note (#23318)
* Fix `UserCleanupScheduler` crash when an unconfirmed account has a moderation note * Add tests
Diffstat (limited to 'app/workers/scheduler')
-rw-r--r-- | app/workers/scheduler/user_cleanup_scheduler.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/workers/scheduler/user_cleanup_scheduler.rb b/app/workers/scheduler/user_cleanup_scheduler.rb index 63f9ed78c..45cfbc62e 100644 --- a/app/workers/scheduler/user_cleanup_scheduler.rb +++ b/app/workers/scheduler/user_cleanup_scheduler.rb @@ -15,7 +15,7 @@ class Scheduler::UserCleanupScheduler def clean_unconfirmed_accounts! User.where('confirmed_at is NULL AND confirmation_sent_at <= ?', 2.days.ago).reorder(nil).find_in_batches do |batch| # We have to do it separately because of missing database constraints - AccountModerationNote.where(account_id: batch.map(&:account_id)).delete_all + AccountModerationNote.where(target_account_id: batch.map(&:account_id)).delete_all Account.where(id: batch.map(&:account_id)).delete_all User.where(id: batch.map(&:id)).delete_all end |