mirror of
https://github.com/internetee/registry.git
synced 2025-05-21 11:49:40 +02:00
Duplicate domain validation
This commit is contained in:
parent
1f29925004
commit
b6ef81fe31
3 changed files with 20 additions and 2 deletions
|
@ -1,7 +1,16 @@
|
|||
module Epp::DomainsHelper
|
||||
def create_domain
|
||||
domain = Domain.create!(domain_create_params)
|
||||
render '/epp/domains/create'
|
||||
domain = Domain.new(domain_create_params)
|
||||
|
||||
if domain.save
|
||||
render '/epp/domains/create'
|
||||
else
|
||||
if domain.errors.added?(:name_dirty, :taken)
|
||||
@code = '2302'
|
||||
@msg = 'Domain name already exists'
|
||||
end
|
||||
render '/epp/error'
|
||||
end
|
||||
end
|
||||
|
||||
def check_domain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue