-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add poll message on start of grace period for soft delete
Add removing forceDelete on registrant change. Restore email template choosing on safe force delete via admin dashboard. See #1428 (comment)
- Loading branch information
Showing
8 changed files
with
85 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Concerns | ||
module Job | ||
module ForceDelete | ||
extend ActiveSupport::Concern | ||
|
||
class_methods do | ||
def start_client_hold | ||
log_prepare_client_hold | ||
|
||
::PaperTrail.whodunnit = "cron - #{__method__}" | ||
|
||
::Domain.force_delete_scheduled.each do |domain| | ||
proceed_client_hold(domain: domain) | ||
log_end_end_client_hold(domain) | ||
end | ||
end | ||
|
||
def proceed_client_hold(domain:) | ||
notify_on_grace_period(domain) if domain.should_notify_on_soft_force_delete? | ||
return unless domain.client_holdable? | ||
|
||
domain.statuses << DomainStatus::CLIENT_HOLD | ||
log_start_client_hold(domain) | ||
|
||
domain.save(validate: false) | ||
notify_client_hold(domain) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module Concerns | ||
module Job | ||
module ForceDeleteMessages | ||
extend ActiveSupport::Concern | ||
|
||
class_methods do | ||
def log_prepare_client_hold | ||
return if Rails.env.test? | ||
|
||
STDOUT << "#{Time.zone.now.utc} - Setting client_hold to domains\n" | ||
end | ||
|
||
def log_start_client_hold(domain) | ||
return if Rails.env.test? | ||
|
||
STDOUT << "#{Time.zone.now.utc} DomainCron.start_client_hold: ##{domain.id} "\ | ||
"(#{domain.name}) #{domain.changes}\n" | ||
end | ||
|
||
def log_end_end_client_hold(domain) | ||
return if Rails.env.test? | ||
|
||
STDOUT << "#{Time.zone.now.utc} - Successfully set client_hold on (#{domain.name})" | ||
end | ||
|
||
def notify_client_hold(domain) | ||
domain.registrar.notifications.create!(text: I18n.t('client_hold_set_on_domain', | ||
domain_name: domain.name, | ||
date: domain.force_delete_start)) | ||
end | ||
|
||
def notify_on_grace_period(domain) | ||
domain.registrar.notifications.create!(text: I18n.t('grace_period_started_domain', | ||
domain_name: domain.name, | ||
date: domain.force_delete_start)) | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters