Merge pull request #2167 from internetee/93-locked-domains-failed-after-fc

93 locked domains failed after fc
This commit is contained in:
Timo Võhmar 2021-10-21 11:02:06 +03:00 committed by GitHub
commit dbb58bc2e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 108 additions and 24 deletions

View file

@ -23,6 +23,7 @@ module Domain::RegistryLockable
end
def apply_statuses_locked_statuses(extensions_prohibited:)
self.admin_store_statuses_history = self.statuses
self.statuses |= LOCK_STATUSES
self.statuses |= EXTENSIONS_STATUS if Feature.obj_and_extensions_statuses_enabled? && extensions_prohibited
self.locked_by_registrant_at = Time.zone.now
@ -35,7 +36,7 @@ module Domain::RegistryLockable
(statuses & [DomainStatus::PENDING_DELETE_CONFIRMATION,
DomainStatus::PENDING_CREATE, DomainStatus::PENDING_UPDATE,
DomainStatus::PENDING_DELETE, DomainStatus::PENDING_RENEW,
DomainStatus::PENDING_TRANSFER, DomainStatus::FORCE_DELETE]).empty?
DomainStatus::PENDING_TRANSFER]).empty?
end
def locked_by_registrant?

View file

@ -122,7 +122,7 @@ class Domain < ApplicationRecord
def status_is_consistant
has_error = (hold_status? && statuses.include?(DomainStatus::SERVER_MANUAL_INZONE))
if !has_error && (statuses & DELETE_STATUSES).any?
has_error = statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED
has_error = statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED unless locked_by_registrant?
end
errors.add(:domains, I18n.t(:object_status_prohibits_operation)) if has_error
end

View file

@ -23,7 +23,7 @@ class RegistrantUser < User
company_register.representation_rights(citizen_personal_code: ident,
citizen_country_code: country.alpha3)
end
def contacts(representable: true)
Contact.registrant_user_contacts(self, representable: representable)
end