mirror of
https://github.com/internetee/registry.git
synced 2025-06-13 16:14:47 +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 +
|
||||
Domain.where(registrant_id: registrant_ids)
|
||||
|
||||
return if expired_or_hold_domains_exists?(domains)
|
||||
|
||||
domains.each do |domain|
|
||||
next if domain.expired?
|
||||
|
||||
|
@ -20,6 +22,12 @@ module Domains
|
|||
|
||||
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)
|
||||
if domain.force_delete_scheduled? && !domain.status_notes[DomainStatus::FORCE_DELETE].nil?
|
||||
added_additional_email_into_notes(domain)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue