115693873-initiator_catches

This commit is contained in:
Stas 2016-06-15 18:27:28 +03:00
parent b03e6c01ac
commit abf736e540
3 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,7 @@ class Admin::PendingDeletesController < AdminController
def update def update
authorize! :update, :pending authorize! :update, :pending
if registrant_verification.domain_registrant_delete_confirm! if registrant_verification.domain_registrant_delete_confirm!("admin #{current_user.username}")
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 admin_edit_domain_path(@domain.id), alert: t(:failure) redirect_to admin_edit_domain_path(@domain.id), alert: t(:failure)
@ -15,7 +15,7 @@ class Admin::PendingDeletesController < AdminController
def destroy def destroy
authorize! :destroy, :pending authorize! :destroy, :pending
if registrant_verification.domain_registrant_delete_reject! if registrant_verification.domain_registrant_delete_reject!("admin #{current_user.username}")
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)

View file

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

View file

@ -1,6 +1,6 @@
class DomainDeleteConfirmJob < Que::Job class DomainDeleteConfirmJob < Que::Job
def run(domain_id, action, initiator = nil) def run(domain_id, action, initiator = nil)
::PaperTrail.whodunnit = "job - #{self.class.name} - #{action}" ::PaperTrail.whodunnit = "job - #{self.class.name} - #{action} by #{initiator}"
# it's recommended to keep transaction against job table as short as possible. # it's recommended to keep transaction against job table as short as possible.
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
domain = Epp::Domain.find(domain_id) domain = Epp::Domain.find(domain_id)