mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
changed method for add additional mails in status notes
This commit is contained in:
parent
7bec1b5880
commit
2c37e30923
3 changed files with 19 additions and 3 deletions
|
@ -5,7 +5,7 @@ module Domains
|
|||
domain.force_delete_data = nil
|
||||
domain.force_delete_date = nil
|
||||
domain.force_delete_start = nil
|
||||
domain.status_notes[DomainStatus::FORCE_DELETE] = nil
|
||||
domain.status_notes[DomainStatus::FORCE_DELETE] = ''
|
||||
domain.save(validate: false)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,7 +11,13 @@ module Domains
|
|||
domains = domain_contacts.map(&:domain).flatten +
|
||||
Domain.where(registrant_id: registrant_ids)
|
||||
|
||||
domains.each { |domain| process_force_delete(domain) unless domain.force_delete_scheduled? }
|
||||
domains.each do |domain|
|
||||
if domain.force_delete_scheduled?
|
||||
added_additional_email_into_notes(domain)
|
||||
else
|
||||
process_force_delete(domain)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -24,7 +30,17 @@ module Domains
|
|||
save_status_note(domain)
|
||||
end
|
||||
|
||||
def added_additional_email_into_notes(domain)
|
||||
if !domain.status_notes[DomainStatus::FORCE_DELETE].include? email
|
||||
domain.status_notes[DomainStatus::FORCE_DELETE].concat(" " + email)
|
||||
domain.save(validate: false)
|
||||
end
|
||||
end
|
||||
|
||||
def save_status_note(domain)
|
||||
# puts "Is blank? #{domain.status_notes[DomainStatus::FORCE_DELETE].blank?}" -> true
|
||||
# puts "Is nil? #{domain.status_notes[DomainStatus::FORCE_DELETE].nil?}" -> true
|
||||
# puts "Is present? #{domain.status_notes[DomainStatus::FORCE_DELETE].present?}" -> false
|
||||
domain.status_notes[DomainStatus::FORCE_DELETE] = email
|
||||
domain.save(validate: false)
|
||||
end
|
||||
|
|
|
@ -31,6 +31,6 @@
|
|||
= f.label :country_code, t(:country) + '*'
|
||||
.col-md-7
|
||||
- country_selected = f.object.persisted? ? f.object.country_code : 'EE'
|
||||
= f.select(:country_code, SApplicationController.helpers.all_country_options(country_selected),
|
||||
= f.select(:country_code, ApplicationController.helpers.all_country_options(country_selected),
|
||||
{ include_blank: true }, required: true)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue