0
0
Fork 0

Fix deletion of unconfirmed users with Webauthn set (#33186)

This commit is contained in:
Claire 2024-12-05 10:38:48 +01:00 committed by GitHub
parent 8b223f3b15
commit 21f6780498
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -19,6 +19,7 @@ class Scheduler::UserCleanupScheduler
User.unconfirmed.where(confirmation_sent_at: ..UNCONFIRMED_ACCOUNTS_MAX_AGE_DAYS.days.ago).find_in_batches do |batch|
# We have to do it separately because of missing database constraints
AccountModerationNote.where(target_account_id: batch.map(&:account_id)).delete_all
WebauthnCredential.where(user_id: batch.map(&:id)).delete_all
Account.where(id: batch.map(&:account_id)).delete_all
User.where(id: batch.map(&:id)).delete_all
end