Registrant domain delete confirmation #2557

This commit is contained in:
Priit Tark 2015-06-17 11:36:55 +03:00
parent f34a7193d4
commit 912ad63fd7
7 changed files with 130 additions and 16 deletions

View file

@ -390,6 +390,15 @@ class Epp::Domain < Domain
clean_pendings! if update(frame, user, false)
end
def apply_pending_delete!
preclean_pendings
user = ApiUser.find(pending_json['current_user_id'])
frame = Nokogiri::XML(pending_json['frame'])
statuses.delete(DomainStatus::PENDING_DELETE)
clean_pendings! if epp_destroy(frame, user, false)
end
def attach_legal_document(legal_document_data)
return unless legal_document_data
@ -399,10 +408,10 @@ class Epp::Domain < Domain
)
end
def epp_destroy(frame, user_id)
def epp_destroy(frame, user_id, verify=true)
return false unless valid?
if frame.css('delete').attr('verified').to_s.downcase != 'yes'
if verify && frame.css('delete').attr('verified').to_s.downcase != 'yes'
registrant_verification_asked!(frame.to_s, user_id)
self.deliver_emails = true # turn on email delivery for epp
pending_delete!

View file

@ -17,12 +17,24 @@ class RegistrantVerification < ActiveRecord::Base
def domain_registrant_change_confirm!
self.action_type = DOMAIN_REGISTRANT_CHANGE
self.action = CONFIRMED
DomainConfirmJob.enqueue domain.id, CONFIRMED if save
DomainUpdateConfirmJob.enqueue domain.id, CONFIRMED if save
end
def domain_registrant_change_reject!
self.action_type = DOMAIN_REGISTRANT_CHANGE
self.action = REJECTED
DomainConfirmJob.enqueue domain.id, REJECTED if save
DomainUpdateConfirmJob.enqueue domain.id, REJECTED if save
end
def domain_registrant_delete_confirm!
self.action_type = DOMAIN_DELETE
self.action = CONFIRMED
DomainDeleteConfirmJob.enqueue domain.id, CONFIRMED if save
end
def domain_registrant_delete_reject!
self.action_type = DOMAIN_DELETE
self.action = REJECTED
DomainDeleteConfirmJob.enqueue domain.id, REJECTED if save
end
end