Browse Source

Fix not being able to suspend accounts that already have a canonical e-mail block (#16455)

closed-social-v3
Eugen Rochko 1 year ago
parent
commit
6b98fd0b4f
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/models/account.rb

+ 5
- 1
app/models/account.rb View File

@ -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…
Cancel
Save