mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
fixed lift force delete during contact update
This commit is contained in:
parent
0a06a36499
commit
ba9fc0c4ec
2 changed files with 16 additions and 1 deletions
|
@ -24,6 +24,7 @@ module Actions
|
|||
|
||||
def maybe_change_email
|
||||
return if Rails.env.test?
|
||||
return if contact.email == new_attributes[:email]
|
||||
|
||||
%i[regex mx].each do |m|
|
||||
result = Actions::SimpleMailValidator.run(email: @new_attributes[:email], level: m)
|
||||
|
@ -71,6 +72,10 @@ module Actions
|
|||
end
|
||||
|
||||
def maybe_update_ident
|
||||
return if contact.identifier.code == ident[:ident] &&
|
||||
contact.identifier.type == ident[:ident_type] &&
|
||||
contact.identifier.country_code == ident[:ident_country_code]
|
||||
|
||||
unless ident.is_a?(Hash)
|
||||
contact.add_epp_error('2308', nil, nil, I18n.t('epp.contacts.errors.valid_ident'))
|
||||
@error = true
|
||||
|
|
|
@ -14,10 +14,20 @@ module EmailVerifable
|
|||
domain_with_fd = domains.select(&:force_delete_scheduled?)
|
||||
|
||||
domain_with_fd.each do |domain|
|
||||
contact_emails_valid?(domain) ? domain.cancel_force_delete : nil
|
||||
cancel_force_delete_if_domain_attributes_are_valid?(domain)
|
||||
end
|
||||
end
|
||||
|
||||
def cancel_force_delete_if_domain_attributes_are_valid?(domain)
|
||||
domain.cancel_force_delete if contact_emails_valid?(domain) && !is_domain_has_invalid_org_contact?(domain)
|
||||
end
|
||||
|
||||
def is_domain_has_invalid_org_contact?(domain)
|
||||
return unless domain.force_delete_scheduled?
|
||||
|
||||
domain.status_notes.any? { |note| note.include?("Company no: #{domain.registrant.identifier.code}") }
|
||||
end
|
||||
|
||||
def contact_emails_valid?(domain)
|
||||
domain.contacts.each do |c|
|
||||
return false unless c.need_to_lift_force_delete?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue