mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Refactor
This commit is contained in:
parent
2862dd81d1
commit
b81c971b37
3 changed files with 11 additions and 33 deletions
|
@ -10,17 +10,17 @@ class Epp::DomainsController < EppController
|
|||
if domain_name.at_auction?
|
||||
@name = domain_name
|
||||
@status = 'At auction'
|
||||
render_epp_response '/epp/domains/info_auction'
|
||||
render_epp_response '/epp/domains/info/unregistered_domain'
|
||||
return
|
||||
elsif domain_name.awaiting_payment?
|
||||
@name = domain_name
|
||||
@status = 'Awaiting payment'
|
||||
render_epp_response '/epp/domains/info_auction'
|
||||
render_epp_response '/epp/domains/info/unregistered_domain'
|
||||
return
|
||||
elsif domain_name.pending_registration?
|
||||
@name = domain_name
|
||||
@status = 'Reserved'
|
||||
render_epp_response '/epp/domains/info_auction'
|
||||
render_epp_response '/epp/domains/info/unregistered_domain'
|
||||
return
|
||||
end
|
||||
end
|
||||
|
@ -42,8 +42,7 @@ class Epp::DomainsController < EppController
|
|||
end
|
||||
|
||||
render_epp_response '/epp/domains/info/registered_domain'
|
||||
else
|
||||
if domain_name.blocked?
|
||||
elsif domain_name.blocked?
|
||||
@name = domain_name
|
||||
@status = 'Blocked'
|
||||
render_epp_response '/epp/domains/info/unregistered_domain'
|
||||
|
@ -53,7 +52,6 @@ class Epp::DomainsController < EppController
|
|||
render_epp_response '/epp/domains/info/unregistered_domain'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
authorize! :create, Epp::Domain
|
||||
|
|
|
@ -53,10 +53,6 @@ module DNS
|
|||
Whois::Record.refresh(self)
|
||||
end
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
|
||||
def registered?
|
||||
Domain.find_by_idn(name)
|
||||
end
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
xml.epp_head do
|
||||
xml.response do
|
||||
xml.result('code' => '1000') do
|
||||
xml.msg 'Command completed successfully'
|
||||
end
|
||||
|
||||
xml.resData do
|
||||
xml.tag! 'domain:infData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd' do
|
||||
xml.tag!('domain:name', @name)
|
||||
xml.tag!('domain:status', 's' => @status)
|
||||
end
|
||||
end
|
||||
|
||||
render('epp/shared/trID', builder: xml)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue