mirror of
https://github.com/internetee/registry.git
synced 2025-06-14 08:34:44 +02:00
Add condition for start force delete
This commit is contained in:
parent
5cb6b0ae1e
commit
04de5da193
1 changed files with 8 additions and 0 deletions
|
@ -11,6 +11,8 @@ module Domains
|
||||||
domains = domain_contacts.map(&:domain).flatten +
|
domains = domain_contacts.map(&:domain).flatten +
|
||||||
Domain.where(registrant_id: registrant_ids)
|
Domain.where(registrant_id: registrant_ids)
|
||||||
|
|
||||||
|
return if expired_or_hold_domains_exists?(domains)
|
||||||
|
|
||||||
domains.each do |domain|
|
domains.each do |domain|
|
||||||
next if domain.expired?
|
next if domain.expired?
|
||||||
|
|
||||||
|
@ -20,6 +22,12 @@ module Domains
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def expired_or_hold_domains_exists?(domains)
|
||||||
|
domains.any? do |domain|
|
||||||
|
domain.statuses.include?(DomainStatus::SERVER_HOLD) && email.include?(domain.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def before_execute_force_delete(domain)
|
def before_execute_force_delete(domain)
|
||||||
if domain.force_delete_scheduled? && !domain.status_notes[DomainStatus::FORCE_DELETE].nil?
|
if domain.force_delete_scheduled? && !domain.status_notes[DomainStatus::FORCE_DELETE].nil?
|
||||||
added_additional_email_into_notes(domain)
|
added_additional_email_into_notes(domain)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue