mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Merge branch '104525314-domain-object-states' into staging
This commit is contained in:
commit
6eddc52d36
2 changed files with 4 additions and 2 deletions
|
@ -6,6 +6,7 @@ class Admin::PendingDeletesController < 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_delete!
|
if @epp_domain.apply_pending_delete!
|
||||||
redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied)
|
redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied)
|
||||||
else
|
else
|
||||||
|
@ -16,6 +17,7 @@ class Admin::PendingDeletesController < AdminController
|
||||||
def destroy
|
def destroy
|
||||||
authorize! :destroy, :pending
|
authorize! :destroy, :pending
|
||||||
|
|
||||||
|
@epp_domain.is_admin= true
|
||||||
if @domain.clean_pendings!
|
if @domain.clean_pendings!
|
||||||
redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed)
|
redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed)
|
||||||
else
|
else
|
||||||
|
|
|
@ -14,9 +14,9 @@ class Domain < ActiveRecord::Base
|
||||||
# TODO: should we user validates_associated :registrant here?
|
# TODO: should we user validates_associated :registrant here?
|
||||||
|
|
||||||
has_many :admin_domain_contacts
|
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
|
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?
|
def registrant_change_prohibited?
|
||||||
statuses.include? DomainStatus::SERVER_REGISTRANT_CHANGE_PROHIBITED
|
statuses.include? DomainStatus::SERVER_REGISTRANT_CHANGE_PROHIBITED
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue