Story #109086524 - force is_admin to skip validation until validations can be fixed

This commit is contained in:
Matt Farnsworth 2015-12-02 13:49:44 +02:00
parent 4ee7294a3f
commit 80fe0428b2
2 changed files with 3 additions and 0 deletions

View file

@ -6,6 +6,8 @@ class Admin::PendingUpdatesController < AdminController
authorize! :update, :pending authorize! :update, :pending
@epp_domain = Epp::Domain.find(params[:domain_id]) # only epp domain has apply pending @epp_domain = Epp::Domain.find(params[:domain_id]) # only epp domain has apply pending
@epp_domain.is_admin = true
if @epp_domain.apply_pending_update! 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

View file

@ -7,6 +7,7 @@ class Epp::Domain < Domain
before_validation :manage_permissions before_validation :manage_permissions
def manage_permissions def manage_permissions
return if is_admin # this bad hack for 109086524, refactor later
return unless update_prohibited? || delete_prohibited? return unless update_prohibited? || delete_prohibited?
add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation)) add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation))
false false