From 196feeb67178d31cb63b695a12cb191fa1bd27bc Mon Sep 17 00:00:00 2001 From: Matt Farnsworth Date: Tue, 10 Nov 2015 18:50:30 +0200 Subject: [PATCH 1/2] Story #104525314 - partial revert previous allow destroy of contacts --- app/models/domain.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 7b744b03c..5580cb837 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -14,9 +14,9 @@ class Domain < ActiveRecord::Base # TODO: should we user validates_associated :registrant here? has_many :admin_domain_contacts - accepts_nested_attributes_for :admin_domain_contacts, allow_destroy: !:admin_change_prohibited?, reject_if: :admin_change_prohibited? + accepts_nested_attributes_for :admin_domain_contacts, allow_destroy: true, reject_if: :admin_change_prohibited? has_many :tech_domain_contacts - accepts_nested_attributes_for :tech_domain_contacts, allow_destroy: !:tech_change_prohibited?, reject_if: :tech_change_prohibited? + accepts_nested_attributes_for :tech_domain_contacts, allow_destroy: true, reject_if: :tech_change_prohibited? def registrant_change_prohibited? statuses.include? DomainStatus::SERVER_REGISTRANT_CHANGE_PROHIBITED From 59522cab5a93f44acfff22cc57be7c163cc0e533 Mon Sep 17 00:00:00 2001 From: Matt Farnsworth Date: Wed, 11 Nov 2015 17:07:34 +0200 Subject: [PATCH 2/2] Story #104525314 - feature conflict, set admin flag from admin controller' --- app/controllers/admin/pending_deletes_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/admin/pending_deletes_controller.rb b/app/controllers/admin/pending_deletes_controller.rb index d885b3a99..4866d65c9 100644 --- a/app/controllers/admin/pending_deletes_controller.rb +++ b/app/controllers/admin/pending_deletes_controller.rb @@ -6,6 +6,7 @@ class Admin::PendingDeletesController < AdminController authorize! :update, :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_delete! redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied) else @@ -16,6 +17,7 @@ class Admin::PendingDeletesController < AdminController def destroy authorize! :destroy, :pending + @epp_domain.is_admin= true if @domain.clean_pendings! redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed) else