mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Change blocked domain error message #2564
This commit is contained in:
parent
0ea07de2d1
commit
a70273a3b9
4 changed files with 8 additions and 5 deletions
|
@ -28,7 +28,7 @@ class Epp::Domain < Domain
|
|||
|
||||
after_destroy :unlink_contacts
|
||||
def unlink_contacts
|
||||
contacts.each do |c|
|
||||
contacts.each do |c|
|
||||
c.domains_present = false
|
||||
c.save(validate: false)
|
||||
end
|
||||
|
@ -104,6 +104,9 @@ class Epp::Domain < Domain
|
|||
[:base, :key_data_not_allowed],
|
||||
[:period, :not_a_number],
|
||||
[:period, :not_an_integer]
|
||||
],
|
||||
'2308' => [
|
||||
[:base, :domain_name_blocked, { value: { obj: 'name', val: name_dirty } }]
|
||||
]
|
||||
}
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
if !self.class.validate_format(value)
|
||||
record.errors[attribute] << (options[:message] || record.errors.generate_message(attribute, :invalid))
|
||||
elsif !self.class.validate_blocked(value)
|
||||
record.errors.add(attribute, (options[:message] || record.errors.generate_message(attribute, :blocked)))
|
||||
record.errors.add(:base, :domain_name_blocked)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -65,10 +65,10 @@ en:
|
|||
key_data_not_allowed: 'keyData object is not allowed'
|
||||
required_parameter_missing_reserved: 'Required parameter missing; reserved>pw element required for reserved domains'
|
||||
invalid_auth_information_reserved: 'Invalid authorization information; invalid reserved>pw value'
|
||||
domain_name_blocked: 'Data management policy violation: Domain name is blocked [name]'
|
||||
name_dirty:
|
||||
invalid: 'Domain name is invalid'
|
||||
reserved: 'Domain name is reserved'
|
||||
blocked: 'Domain name is blocked'
|
||||
taken: 'Domain name already exists'
|
||||
puny_label:
|
||||
too_long: 'Domain name is too long (maximum is 63 characters)'
|
||||
|
|
|
@ -272,8 +272,8 @@ describe 'EPP Domain', epp: true do
|
|||
xml = domain_create_xml(name: { value: 'ftp.ee' })
|
||||
|
||||
response = epp_plain_request(xml)
|
||||
response[:msg].should == 'Domain name is blocked [name_dirty]'
|
||||
response[:result_code].should == '2302'
|
||||
response[:msg].should == 'Data management policy violation: Domain name is blocked [name]'
|
||||
response[:result_code].should == '2308'
|
||||
response[:results][0][:value].should == 'ftp.ee'
|
||||
response[:clTRID].should == 'ABC-12345'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue