Prohibit updating domain when in force delete status #2845

This commit is contained in:
Martin Lensment 2015-08-10 13:53:52 +03:00
parent dc5012c772
commit 2c0de95363
2 changed files with 7 additions and 3 deletions

View file

@ -620,6 +620,3 @@ DEPENDENCIES
uuidtools (~> 2.1.4)
validates_email_format_of (~> 1.6.3)
whenever (~> 0.9.4)
BUNDLED WITH
1.10.6

View file

@ -105,6 +105,13 @@ class Domain < ActiveRecord::Base
errors.add(:base, :invalid_auth_information_reserved)
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: {
min: -> { Setting.ns_min_count },
max: -> { Setting.ns_max_count }