mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 10:19:45 +02:00
Story: #104525314 - send error message to user if hold and inManualZone
This commit is contained in:
parent
d17366405b
commit
8744f23928
2 changed files with 7 additions and 1 deletions
|
@ -52,7 +52,7 @@ class Admin::DomainsController < AdminController
|
||||||
redirect_to [:admin, @domain]
|
redirect_to [:admin, @domain]
|
||||||
else
|
else
|
||||||
build_associations
|
build_associations
|
||||||
flash.now[:alert] = I18n.t('failed_to_update_domain')
|
flash.now[:alert] = I18n.t('failed_to_update_domain') + ' ' + @domain.errors.full_messages.join(", ")
|
||||||
render 'edit'
|
render 'edit'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -109,6 +109,12 @@ class Domain < ActiveRecord::Base
|
||||||
errors.add(:base, :invalid_auth_information_reserved)
|
errors.add(:base, :invalid_auth_information_reserved)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
validate :status_is_consistant
|
||||||
|
def status_is_consistant
|
||||||
|
has_error = (statuses.include?(DomainStatus::SERVER_HOLD) && statuses.include?(DomainStatus::SERVER_MANUAL_INZONE))
|
||||||
|
errors.add(:domains, I18n.t(:object_status_prohibits_operation)) if has_error
|
||||||
|
end
|
||||||
|
|
||||||
attr_accessor :is_admin
|
attr_accessor :is_admin
|
||||||
|
|
||||||
validate :check_permissions, :unless => :is_admin
|
validate :check_permissions, :unless => :is_admin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue