mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 01:36:02 +02:00
104989420-validation logic changes
This commit is contained in:
parent
b50f954aa8
commit
4203e4a6f4
1 changed files with 8 additions and 3 deletions
|
@ -1,5 +1,4 @@
|
||||||
class Epp::DomainsController < EppController
|
class Epp::DomainsController < EppController
|
||||||
include EppErrors
|
|
||||||
before_action :find_domain, only: [:info, :renew, :update, :transfer, :delete]
|
before_action :find_domain, only: [:info, :renew, :update, :transfer, :delete]
|
||||||
before_action :find_password, only: [:info, :update, :transfer, :delete]
|
before_action :find_password, only: [:info, :update, :transfer, :delete]
|
||||||
|
|
||||||
|
@ -29,8 +28,9 @@ 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 || @domain_pricelist.valid_from > Time.zone.now
|
if !@domain_pricelist.try(:price)#checking if pricelist is not found
|
||||||
add_epp_error('2306', nil, nil, 'No price lists for domain')
|
@domain.add_epp_error('2306', nil, nil, 'No price list for domain')
|
||||||
|
handle_errors(@domain) and return if @domain.errors.any?
|
||||||
end
|
end
|
||||||
|
|
||||||
handle_errors and return unless balance_ok?('create')
|
handle_errors and return unless balance_ok?('create')
|
||||||
|
@ -105,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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue