Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2021-07-17 17:45:35 +02:00
8 changed files with 19 additions and 36 deletions

View File

@ -236,11 +236,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