fix remove account

This commit is contained in:
Pete Matsyburka committed 2026-11-15 09:49:17 +02:00
1 parent 3b4fdd1615
commit d45ff6b2af
1 file changed
+4 -2
+4 -2
View File
@@ -49,9 +49,11 @@ class AccountsController < ApplicationController
def destroy def destroy
authorize!(:manage, current_account) authorize!(:manage, current_account)
removed_email = true_user.email.sub('@', '+removed@')
removed_email = true_user.email.sub('@', "+removed#{Time.current.to_i}@") if User.exists?(email: removed_email)
true_user.skip_reconfirmation! true_user.skip_reconfirmation!
true_user.update!(locked_at: Time.current, archived_at: Time.current, true_user.update!(locked_at: Time.current, archived_at: Time.current, email: removed_email)
email: true_user.email.sub('@', '+removed@'))
true_user.account.update!(archived_at: Time.current) true_user.account.update!(archived_at: Time.current)
# rubocop:disable-next Layout/LineLength # rubocop:disable-next Layout/LineLength