mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix not being able to suspend accounts that already have a canonical e-mail block (#16455)
This commit is contained in:
parent
c7f534ab95
commit
6b98fd0b4f
@ -574,7 +574,11 @@ class Account < ApplicationRecord
|
||||
def create_canonical_email_block!
|
||||
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
|
||||
|
||||
def destroy_canonical_email_block!
|
||||
|
Loading…
x
Reference in New Issue
Block a user