Story #109086524 - change execution path, admin will now use same method as registrant to apply pending update

This change now include creating registrar message
This commit is contained in:
Matt Farnsworth 2015-12-13 13:09:43 +02:00
parent db870574c2
commit 226e82c71a

View file

@ -5,10 +5,7 @@ class Admin::PendingUpdatesController < AdminController
def update def update
authorize! :update, :pending authorize! :update, :pending
@epp_domain = Epp::Domain.find(params[:domain_id]) # only epp domain has apply pending if registrant_verification.domain_registrant_change_confirm!
@epp_domain.is_admin = true
if @epp_domain.apply_pending_update!
redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied) redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied)
else else
redirect_to edit_admin_domain_path(@domain.id), alert: t(:failure) redirect_to edit_admin_domain_path(@domain.id), alert: t(:failure)
@ -17,14 +14,21 @@ class Admin::PendingUpdatesController < AdminController
def destroy def destroy
authorize! :destroy, :pending authorize! :destroy, :pending
if registrant_verification.domain_registrant_change_reject!
if @domain.clean_pendings!
redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed) redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed)
else else
redirect_to admin_domain_path(@domain.id), alert: t(:failure) redirect_to admin_domain_path(@domain.id), alert: t(:failure)
end end
end end
def registrant_verification
# steal token
token = @domain.registrant_verification_token
@registrant_verification = RegistrantVerification.new(domain_id: @domain.id,
domain_name: @domain.name,
verification_token: token)
end
private private
def find_domain def find_domain