mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
Fix not being able to suspend accounts that already have a canonical e-mail block (#16455)
This commit is contained in:
parent
92c8c30e17
commit
38b3419950
@ -570,7 +570,11 @@ class Account < ApplicationRecord
|
|||||||
def create_canonical_email_block!
|
def create_canonical_email_block!
|
||||||
return unless local? && user_email.present?
|
return unless local? && user_email.present?
|
||||||
|
|
||||||
CanonicalEmailBlock.create(reference_account: self, email: user_email)
|
begin
|
||||||
|
CanonicalEmailBlock.create(reference_account: self, email: user_email)
|
||||||
|
rescue ActiveRecord::RecordNotUnique
|
||||||
|
# A canonical e-mail block may already exist for the same e-mail
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy_canonical_email_block!
|
def destroy_canonical_email_block!
|
||||||
|
Loading…
Reference in New Issue
Block a user