mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
Add pull messages on soft force delete & force delete cancel
This commit is contained in:
parent
c863cb2678
commit
222ac639ac
4 changed files with 14 additions and 1 deletions
|
@ -57,6 +57,7 @@ module Concerns::Domain::ForceDelete
|
||||||
self.force_delete_date = nil
|
self.force_delete_date = nil
|
||||||
self.force_delete_start = nil
|
self.force_delete_start = nil
|
||||||
save(validate: false)
|
save(validate: false)
|
||||||
|
registrar.notifications.create!(text: I18n.t('force_delete_cancelled', domain_name: name))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -94,7 +94,7 @@ class DomainCron
|
||||||
domain.statuses << DomainStatus::CLIENT_HOLD
|
domain.statuses << DomainStatus::CLIENT_HOLD
|
||||||
log_start_client_hold(domain)
|
log_start_client_hold(domain)
|
||||||
|
|
||||||
domain.save(validate: false) and marked += 1
|
domain.save(validate: false) and marked += 1 and notify_client_hold(domain)
|
||||||
end
|
end
|
||||||
|
|
||||||
log_end_end_client_hold(marked: marked, real: real)
|
log_end_end_client_hold(marked: marked, real: real)
|
||||||
|
@ -120,4 +120,10 @@ class DomainCron
|
||||||
STDOUT << "#{Time.zone.now.utc} - Successfully set client_hold to #{marked} of #{real} "\
|
STDOUT << "#{Time.zone.now.utc} - Successfully set client_hold to #{marked} of #{real} "\
|
||||||
"domains\n"
|
"domains\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.notify_client_hold(domain)
|
||||||
|
domain.registrar.notifications.create!(text: I18n.t('soft_force_delete_set_on_domain',
|
||||||
|
domain_name: domain.name,
|
||||||
|
start_date: domain.force_delete_start))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -619,6 +619,8 @@ en:
|
||||||
created_at_until: 'Created at until'
|
created_at_until: 'Created at until'
|
||||||
is_registrant: 'Is registrant'
|
is_registrant: 'Is registrant'
|
||||||
force_delete_set_on_domain: 'Force delete set on domain %{domain_name}'
|
force_delete_set_on_domain: 'Force delete set on domain %{domain_name}'
|
||||||
|
soft_force_delete_set_on_domain: 'clientHold status is set for domain %{domain_name}, ForceDelete is in effect from %{start_date}'
|
||||||
|
force_delete_cancelled: 'Force delete is cancelled on domain %{domain_name}'
|
||||||
contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact'
|
contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact'
|
||||||
next: 'Next'
|
next: 'Next'
|
||||||
previous: 'Previous'
|
previous: 'Previous'
|
||||||
|
|
|
@ -46,6 +46,10 @@ if @cron_group == 'registry'
|
||||||
runner 'DomainCron.start_redemption_grace_period'
|
runner 'DomainCron.start_redemption_grace_period'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
every 1.hour do
|
||||||
|
runner 'DomainCron.start_client_hold'
|
||||||
|
end
|
||||||
|
|
||||||
every '0 0 1 * *' do
|
every '0 0 1 * *' do
|
||||||
runner 'Directo.send_monthly_invoices'
|
runner 'Directo.send_monthly_invoices'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue