mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Domain pricelist validation
This commit is contained in:
parent
dc6b9ac924
commit
b50f954aa8
1 changed files with 5 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
class Epp::DomainsController < EppController
|
||||
include EppErrors
|
||||
before_action :find_domain, only: [:info, :renew, :update, :transfer, :delete]
|
||||
before_action :find_password, only: [:info, :update, :transfer, :delete]
|
||||
|
||||
|
@ -28,6 +29,10 @@ class Epp::DomainsController < EppController
|
|||
@domain.errors.delete(:name_dirty) if @domain.errors[:puny_label].any?
|
||||
handle_errors(@domain) and return if @domain.errors.any?
|
||||
|
||||
if !@domain_pricelist || @domain_pricelist.valid_from > Time.zone.now
|
||||
add_epp_error('2306', nil, nil, 'No price lists for domain')
|
||||
end
|
||||
|
||||
handle_errors and return unless balance_ok?('create')
|
||||
ActiveRecord::Base.transaction do
|
||||
if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue