mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Added registrant successful email confirmation #2557
This commit is contained in:
parent
9f2d87606d
commit
8102b8f1a2
11 changed files with 169 additions and 18 deletions
|
@ -186,13 +186,10 @@ class Domain < ActiveRecord::Base
|
|||
def start_expire_period
|
||||
STDOUT << "#{Time.zone.now.utc} - Expiring domains\n" unless Rails.env.test?
|
||||
|
||||
d = Domain.where('valid_to <= ?', Time.zone.now)
|
||||
d.each do |x|
|
||||
next unless x.expirable?
|
||||
x.statuses << DomainStatus::EXPIRED
|
||||
# TODO: This should be managed by automatic_statuses
|
||||
x.statuses.delete(DomainStatus::OK)
|
||||
x.save(validate: false)
|
||||
domains = Domain.where('valid_to <= ?', Time.zone.now)
|
||||
domains.each do |domain|
|
||||
next unless domain.expirable?
|
||||
domain.set_expired!
|
||||
end
|
||||
|
||||
STDOUT << "#{Time.zone.now.utc} - Successfully expired #{d.count} domains\n" unless Rails.env.test?
|
||||
|
@ -517,6 +514,19 @@ class Domain < ActiveRecord::Base
|
|||
save(validate: false)
|
||||
end
|
||||
|
||||
def set_expired
|
||||
# TODO: currently valid_to attribute update logic is open
|
||||
# self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
|
||||
self.outzone_at = Time.zone.now + Setting.expire_warning_period.days
|
||||
self.delete_at = Time.zone.now + Setting.redemption_grace_period.days
|
||||
statuses << DomainStatus::EXPIRED
|
||||
end
|
||||
|
||||
def set_expired!
|
||||
set_expired
|
||||
save(validate: false)
|
||||
end
|
||||
|
||||
def manage_automatic_statuses
|
||||
# domain_statuses.create(value: DomainStatus::DELETE_CANDIDATE) if delete_candidateable?
|
||||
if statuses.empty? && valid?
|
||||
|
|
|
@ -398,7 +398,11 @@ class Epp::Domain < Domain
|
|||
frame = Nokogiri::XML(pending_json['frame'])
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
|
||||
clean_pendings! if update(frame, user, false)
|
||||
if update(frame, user, false)
|
||||
clean_pendings!
|
||||
self.deliver_emails = true # turn on email delivery for epp
|
||||
DomainMailer.registrant_updated(self).deliver_now
|
||||
end
|
||||
end
|
||||
|
||||
def apply_pending_delete!
|
||||
|
@ -429,7 +433,7 @@ class Epp::Domain < Domain
|
|||
manage_automatic_statuses
|
||||
true # aka 1001 pending_delete
|
||||
else
|
||||
destroy
|
||||
set_expired!
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue