diff --git a/app/models/domain.rb b/app/models/domain.rb index 49f18d9db..88fa94fbc 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -574,7 +574,7 @@ class Domain < ApplicationRecord if statuses.empty? && valid? statuses << DomainStatus::OK - elsif (statuses.length > 1 && active?) || !valid? + elsif (statuses.length > 1) || !valid? statuses.delete(DomainStatus::OK) end diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index d8f5f2bb9..6a51b4cfe 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -27,7 +27,7 @@ class Epp::Domain < Domain active_techs = tech_domain_contacts.select { |x| !x.marked_for_destruction? } # validate registrant here as well - ([registrant] + active_admins + active_techs).each do |x| + ([Contact.find_by(code: registrant.code)] + active_admins + active_techs).each do |x| unless x.valid? add_epp_error('2304', nil, nil, I18n.t(:contact_is_not_valid, value: x.code)) ok = false