]> cat aescling's git repositories - mastodon.git/commitdiff
Fix error when a MX is shared across blocked domains (#17650)
authorClaire <claire.github-309c@sitedethib.com>
Sat, 26 Feb 2022 16:26:28 +0000 (17:26 +0100)
committerGitHub <noreply@github.com>
Sat, 26 Feb 2022 16:26:28 +0000 (17:26 +0100)
app/controllers/admin/email_domain_blocks_controller.rb

index 33ee079f36d634650bcac854c210ee55ce55923d..a4bbbba5bad2f59baa6315e1a7282e714a952bf1 100644 (file)
@@ -38,6 +38,8 @@ module Admin
           log_action :create, @email_domain_block
 
           (@email_domain_block.other_domains || []).uniq.each do |domain|
+            next if EmailDomainBlock.where(domain: domain).exists?
+
             other_email_domain_block = EmailDomainBlock.create!(domain: domain, parent: @email_domain_block)
             log_action :create, other_email_domain_block
           end