115693873-initiator_fix

This commit is contained in:
Stas 2016-07-10 22:44:56 +03:00
parent f97bab5f87
commit dce585344e
3 changed files with 11 additions and 4 deletions

View file

@ -20,8 +20,11 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
@registrant_verification = RegistrantVerification.new(domain_id: @domain.id,
domain_name: @domain.name,
verification_token: params[:token])
initiator = current_user ? current_user.username : t(:user_not_authorized)
if params[:rejected]
if @registrant_verification.domain_registrant_delete_reject!("email link #{current_user.username}")
if @registrant_verification.domain_registrant_delete_reject!("email link #{initiator}")
flash[:notice] = t(:registrant_domain_verification_rejected)
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true)
else
@ -29,7 +32,7 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
return render 'show'
end
elsif params[:confirmed]
if @registrant_verification.domain_registrant_delete_confirm!("email link #{current_user.username}")
if @registrant_verification.domain_registrant_delete_confirm!("email link #{initiator}")
flash[:notice] = t(:registrant_domain_verification_confirmed)
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true)
else