Merge branch '111864739-history_legal_doc' into staging

* 111864739-history_legal_doc:
  111864739-contact_and_domain_create
This commit is contained in:
Stas 2016-02-17 18:40:32 +02:00
commit 0c63f0fa54
5 changed files with 67 additions and 18 deletions

View file

@ -19,6 +19,8 @@ class Epp::ContactsController < EppController
authorize! :create, Epp::Contact
@contact = Epp::Contact.new(params[:parsed_frame], current_user.registrar)
@contact.add_legal_file_to_new(params[:parsed_frame])
if @contact.save
render_epp_response '/epp/contacts/create'
else

View file

@ -30,6 +30,8 @@ class Epp::DomainsController < EppController
handle_errors and return unless balance_ok?('create') # loads pricelist in this method
ActiveRecord::Base.transaction do
@domain.add_legal_file_to_new(params[:parsed_frame])
if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain?
current_user.registrar.debit!({
sum: @domain_pricelist.price.amount,