Merge branch '106012880-pricelists' into staging

This commit is contained in:
Stas 2015-11-06 12:52:22 +02:00
commit 7af817104d

View file

@ -28,6 +28,11 @@ class Epp::DomainsController < EppController
@domain.errors.delete(:name_dirty) if @domain.errors[:puny_label].any? @domain.errors.delete(:name_dirty) if @domain.errors[:puny_label].any?
handle_errors(@domain) and return if @domain.errors.any? handle_errors(@domain) and return if @domain.errors.any?
if !@domain_pricelist.try(:price)#checking if pricelist is not found
@domain.add_epp_error('2306', nil, nil, 'No price list for domain')
handle_errors(@domain) and return if @domain.errors.any?
end
handle_errors and return unless balance_ok?('create') handle_errors and return unless balance_ok?('create')
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain? if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain?
@ -100,6 +105,11 @@ class Epp::DomainsController < EppController
period = (period_element.to_i == 0) ? 1 : period_element.to_i period = (period_element.to_i == 0) ? 1 : period_element.to_i
period_unit = Epp::Domain.parse_period_unit_from_frame(params[:parsed_frame]) || 'y' period_unit = Epp::Domain.parse_period_unit_from_frame(params[:parsed_frame]) || 'y'
if !@domain_pricelist.try(:price)#checking if pricelist is not found
@domain.add_epp_error('2306', nil, nil, 'No price list for domain')
handle_errors(@domain) and return if @domain.errors.any?
end
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
success = @domain.renew( success = @domain.renew(
params[:parsed_frame].css('curExpDate').text, params[:parsed_frame].css('curExpDate').text,