mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 01:03:35 +02:00
Prohibit updating domain when in force delete status #2845
This commit is contained in:
parent
dc5012c772
commit
2c0de95363
2 changed files with 7 additions and 3 deletions
|
@ -620,6 +620,3 @@ DEPENDENCIES
|
||||||
uuidtools (~> 2.1.4)
|
uuidtools (~> 2.1.4)
|
||||||
validates_email_format_of (~> 1.6.3)
|
validates_email_format_of (~> 1.6.3)
|
||||||
whenever (~> 0.9.4)
|
whenever (~> 0.9.4)
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
1.10.6
|
|
||||||
|
|
|
@ -105,6 +105,13 @@ class Domain < ActiveRecord::Base
|
||||||
errors.add(:base, :invalid_auth_information_reserved)
|
errors.add(:base, :invalid_auth_information_reserved)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
validate :check_permissions
|
||||||
|
def check_permissions
|
||||||
|
return unless update_prohibited? || delete_prohibited?
|
||||||
|
errors.add(:base, I18n.t(:object_status_prohibits_operation))
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
validates :nameservers, object_count: {
|
validates :nameservers, object_count: {
|
||||||
min: -> { Setting.ns_min_count },
|
min: -> { Setting.ns_min_count },
|
||||||
max: -> { Setting.ns_max_count }
|
max: -> { Setting.ns_max_count }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue