From d4b84a58dfff515d9317a49c3f4427ee5ea51ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Mon, 11 Jan 2021 16:16:07 +0200 Subject: [PATCH] Fix disclosable scope when copying registrant to admin/tech --- app/models/epp/domain.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index c4106e45a..51bd4f8bc 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -110,8 +110,10 @@ class Epp::Domain < Domain def attach_default_contacts return if registrant.blank? - tech_contacts << registrant if tech_domain_contacts.blank? - admin_contacts << registrant if admin_domain_contacts.blank? && !registrant.org? + registrant_obj = Contact.find_by(code: registrant.code) + + tech_contacts << registrant_obj if tech_domain_contacts.blank? + admin_contacts << registrant_obj if admin_domain_contacts.blank? && !registrant.org? end def apply_pending_delete!