Merge pull request #1786 from internetee/fix-statuses-processing

Fix automatic status handling / exposed contact attributes
This commit is contained in:
Timo Võhmar 2021-01-05 18:33:18 +02:00 committed by GitHub
commit 7ebcec548f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -574,7 +574,7 @@ class Domain < ApplicationRecord
if statuses.empty? && valid? if statuses.empty? && valid?
statuses << DomainStatus::OK statuses << DomainStatus::OK
elsif (statuses.length > 1 && active?) || !valid? elsif (statuses.length > 1) || !valid?
statuses.delete(DomainStatus::OK) statuses.delete(DomainStatus::OK)
end end

View file

@ -27,7 +27,7 @@ class Epp::Domain < Domain
active_techs = tech_domain_contacts.select { |x| !x.marked_for_destruction? } active_techs = tech_domain_contacts.select { |x| !x.marked_for_destruction? }
# validate registrant here as well # 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? unless x.valid?
add_epp_error('2304', nil, nil, I18n.t(:contact_is_not_valid, value: x.code)) add_epp_error('2304', nil, nil, I18n.t(:contact_is_not_valid, value: x.code))
ok = false ok = false