From: Claire Date: Sat, 26 Feb 2022 16:26:28 +0000 (+0100) Subject: Fix error when a MX is shared across blocked domains (#17650) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=6aef76b5cde2315135d53215d13a9b2ec0a1adaa;p=mastodon.git Fix error when a MX is shared across blocked domains (#17650) --- diff --git a/app/controllers/admin/email_domain_blocks_controller.rb b/app/controllers/admin/email_domain_blocks_controller.rb index 33ee079f3..a4bbbba5b 100644 --- a/app/controllers/admin/email_domain_blocks_controller.rb +++ b/app/controllers/admin/email_domain_blocks_controller.rb @@ -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