Fix user email address being banned on self-deletion (#16503)
* Add tests * Fix user email address being banned on self-deletion Fixes #16498
This commit is contained in:
parent
31593d1426
commit
30ce6e395c
3 changed files with 7 additions and 3 deletions
|
@ -232,11 +232,11 @@ class Account < ApplicationRecord
|
|||
suspended? && deletion_request.present?
|
||||
end
|
||||
|
||||
def suspend!(date: Time.now.utc, origin: :local)
|
||||
def suspend!(date: Time.now.utc, origin: :local, block_email: true)
|
||||
transaction do
|
||||
create_deletion_request!
|
||||
update!(suspended_at: date, suspension_origin: origin)
|
||||
create_canonical_email_block!
|
||||
create_canonical_email_block! if block_email
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue