Story#111503520 - couldn't apply pending update as registrar wasn't valid

This commit is contained in:
Vladimir Krylov 2016-01-12 14:06:32 +02:00
parent 438b22f19d
commit b28748d667
2 changed files with 8 additions and 12 deletions

View file

@ -507,18 +507,17 @@ class Epp::Domain < Domain
frame = Nokogiri::XML(pending_json['frame'])
self.deliver_emails = true # turn on email delivery
send_mail :registrant_updated_notification_for_old_registrant
statuses.delete(DomainStatus::PENDING_UPDATE)
yield(self) if block_given? # need to skip statuses check here
self.save
self.statuses.delete(DomainStatus::PENDING_UPDATE)
::PaperTrail.whodunnit = user.id_role_username # updator str should be the request originator not the approval user
send_mail :registrant_updated_notification_for_old_registrant
return unless update(frame, user, false)
clean_pendings!
send_mail :registrant_updated_notification_for_new_registrant
update_whois_record
WhoisRecord.find_by(domain_id: id).save # need to reload model
save! # for notification if everything fails
true
end