about summary refs log tree commit diff
path: root/app/controllers/admin/email_domain_blocks_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/admin/email_domain_blocks_controller.rb')
-rw-r--r--app/controllers/admin/email_domain_blocks_controller.rb2
1 files changed, 2 insertions, 0 deletions
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