Attempt to fix renew issues

This commit is contained in:
Karl Erik Õunapuu 2021-02-11 11:23:13 +02:00
parent 42adaa7159
commit aedfeac459
No known key found for this signature in database
GPG key ID: C9DD647298A34764
2 changed files with 4 additions and 0 deletions

View file

@ -56,6 +56,7 @@ module Domains
private
def add_error
domain.add_epp_error(2104, nil, nil, I18n.t(:domain_renew_error_for_domain))
errors.add(:domain, I18n.t('domain_renew_error_for_domain', domain: domain.name))
end
end

View file

@ -60,7 +60,10 @@ module Billing
def self.price_for(zone, operation_category, duration)
lists = valid.where(zone: zone, operation_category: operation_category, duration: duration)
return lists.first if lists.count == 1
lists.order(valid_from: :desc).first
rescue ActiveRecord::StatementInvalid
nil
end
def name