diff --git a/app/controllers/admin/domain_blocks_controller.rb b/app/controllers/admin/domain_blocks_controller.rb index a62f3970912..82dd77fdb6b 100644 --- a/app/controllers/admin/domain_blocks_controller.rb +++ b/app/controllers/admin/domain_blocks_controller.rb @@ -8,6 +8,7 @@ module Admin before_action :populate_domain_block_from_params before_action :prevent_downgrade before_action :attempt_transparent_upgrade, if: :existing_domain_block + before_action :verify_confirmation_needed end PERMITTED_PARAMS = %i( @@ -44,9 +45,6 @@ module Admin end def create - # Require explicit confirmation when suspending - return render :confirm_suspension if requires_confirmation? - if @domain_block.save DomainBlockWorker.perform_async(@domain_block.id) log_action :create, @domain_block @@ -108,6 +106,11 @@ module Admin end end + def verify_confirmation_needed + # Require explicit confirmation when suspending + render :confirm_suspension if requires_confirmation? + end + def existing_domain_block @existing_domain_block ||= DomainBlock.rule_for(resource_params[:domain]) if resource_params[:domain].present? end