Update epp contacts controller

#251
This commit is contained in:
Artur Beljajev 2016-12-08 21:36:25 +02:00
parent c8fd0eb1a4
commit 74598ccf23
2 changed files with 11 additions and 4 deletions

View file

@ -17,9 +17,16 @@ class Epp::ContactsController < EppController
def create def create
authorize! :create, Epp::Contact authorize! :create, Epp::Contact
@contact = Epp::Contact.new(params[:parsed_frame], current_user.registrar) frame = params[:parsed_frame]
@contact = Epp::Contact.new(frame, current_user.registrar)
@contact.add_legal_file_to_new(params[:parsed_frame]) @contact.add_legal_file_to_new(frame)
@response_code = if Contact.address_processing
1000
else
frame.css('postalInfo addr').size != 0 ? 1100 : 1000
end
if @contact.save if @contact.save
render_epp_response '/epp/contacts/create' render_epp_response '/epp/contacts/create'

View file

@ -1,6 +1,6 @@
xml.epp_head do xml.epp_head do
xml.response do xml.response do
xml.result('code' => '1000') do xml.result('code' => @response_code) do
xml.msg 'Command completed successfully' xml.msg 'Command completed successfully'
end end