mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 16:39:55 +02:00
Merge branch 'master' into alpha
This commit is contained in:
commit
b59e5e60e6
8 changed files with 30 additions and 19 deletions
|
@ -12,7 +12,7 @@ class Admin::InvoicesController < AdminController
|
|||
@deposit = Deposit.new(deposit_params.merge(registrar: r))
|
||||
@invoice = @deposit.issue_prepayment_invoice
|
||||
|
||||
if @invoice.persisted?
|
||||
if @invoice && @invoice.persisted?
|
||||
flash[:notice] = t(:record_created)
|
||||
redirect_to [:admin, @invoice]
|
||||
else
|
||||
|
|
|
@ -9,7 +9,7 @@ class Registrar::DepositsController < RegistrarController
|
|||
@deposit = Deposit.new(deposit_params.merge(registrar: current_user.registrar))
|
||||
@invoice = @deposit.issue_prepayment_invoice
|
||||
|
||||
if @invoice.persisted?
|
||||
if @invoice && @invoice.persisted?
|
||||
flash[:notice] = t(:please_pay_the_following_invoice)
|
||||
redirect_to [:registrar, @invoice]
|
||||
else
|
||||
|
|
|
@ -395,6 +395,7 @@ class Epp::Domain < Domain
|
|||
end
|
||||
|
||||
# rubocop: disable Metrics/AbcSize
|
||||
# rubocop: disable Metrics/CyclomaticComplexity
|
||||
def update(frame, current_user, verify = true)
|
||||
return super if frame.blank?
|
||||
at = {}.with_indifferent_access
|
||||
|
@ -411,15 +412,17 @@ class Epp::Domain < Domain
|
|||
|
||||
# at[:statuses] += at_add[:domain_statuses_attributes]
|
||||
|
||||
if verify && Setting.request_confrimation_on_registrant_change_enabled &&
|
||||
frame.css('registrant').present? &&
|
||||
frame.css('registrant').attr('verified').to_s.downcase != 'yes'
|
||||
if verify &&
|
||||
Setting.request_confrimation_on_registrant_change_enabled &&
|
||||
frame.css('registrant').present? &&
|
||||
frame.css('registrant').attr('verified').to_s.downcase != 'yes'
|
||||
registrant_verification_asked!(frame.to_s, current_user.id)
|
||||
end
|
||||
self.deliver_emails = true # turn on email delivery for epp
|
||||
errors.empty? && super(at)
|
||||
end
|
||||
# rubocop: enable Metrics/AbcSize
|
||||
# rubocop: enable Metrics/CyclomaticComplexity
|
||||
|
||||
def apply_pending_update!
|
||||
old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(self)
|
||||
|
@ -458,8 +461,8 @@ class Epp::Domain < Domain
|
|||
return false unless valid?
|
||||
|
||||
if verify &&
|
||||
Setting.request_confirmation_on_domain_deletion_enabled &&
|
||||
frame.css('delete').attr('verified').to_s.downcase != 'yes'
|
||||
Setting.request_confirmation_on_domain_deletion_enabled &&
|
||||
frame.css('delete').attr('verified').to_s.downcase != 'yes'
|
||||
|
||||
registrant_verification_asked!(frame.to_s, user_id)
|
||||
self.deliver_emails = true # turn on email delivery for epp
|
||||
|
|
|
@ -29,7 +29,7 @@ class Invoice < ActiveRecord::Base
|
|||
|
||||
return if number <= Setting.invoice_number_max.to_i
|
||||
|
||||
errors.add(:base, I18n.t('failed_to_generate_invoice'))
|
||||
errors.add(:base, I18n.t('failed_to_generate_invoice_invoice_number_limit_reached'))
|
||||
logger.error('INVOICE NUMBER LIMIT REACHED, COULD NOT GENERATE INVOICE')
|
||||
false
|
||||
end
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:add), new_admin_invoice_path, class: 'btn btn-primary')
|
||||
= render 'shared/title', name: t(:invoices)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
= form_for([:admin, @deposit], url: admin_invoices_path, method: :post, html: { class: 'form-horizontal' }) do |f|
|
||||
= render 'shared/full_errors', object: @deposit
|
||||
|
||||
- if @invoice
|
||||
= render 'shared/full_errors', object: @invoice
|
||||
.row
|
||||
.col-md-8
|
||||
.form-group
|
||||
|
|
|
@ -893,3 +893,4 @@ en:
|
|||
results_per_page: 'Results per page'
|
||||
nameserver_hostname: 'Nameserver hostname'
|
||||
result_count: '%{count} results'
|
||||
failed_to_generate_invoice_invoice_number_limit_reached: 'Failed to generate invoice - invoice number limit reached'
|
||||
|
|
|
@ -2603,15 +2603,20 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
it 'should renew a expired domain' do
|
||||
pending("Please inspect, somehow SERVER_HOLD is false and test fails")
|
||||
domain.valid_to = Time.zone.now - 50.days
|
||||
new_valid_to = domain.valid_to + 1.year
|
||||
domain.outzone_at = Time.zone.now - 50.days
|
||||
new_outzone_at = domain.outzone_at + 1.year
|
||||
new_delete_at = domain.delete_at + 1.year
|
||||
old_valid_to = Time.zone.now - 90.days
|
||||
old_outzone_at = Time.zone.now - 60.days
|
||||
old_delete_at = Time.zone.now - 30.days
|
||||
domain.valid_to = old_valid_to
|
||||
domain.outzone_at = old_outzone_at
|
||||
domain.delete_at = old_delete_at
|
||||
domain.save
|
||||
|
||||
Domain.start_expire_period
|
||||
domain.reload
|
||||
domain.valid_to = old_valid_to
|
||||
domain.outzone_at = old_outzone_at
|
||||
domain.delete_at = old_delete_at
|
||||
domain.save
|
||||
Domain.start_redemption_grace_period
|
||||
|
||||
domain.reload
|
||||
|
@ -2637,9 +2642,11 @@ describe 'EPP Domain', epp: true do
|
|||
domain.statuses.include?(DomainStatus::OK).should == true
|
||||
|
||||
domain.reload
|
||||
domain.valid_to.should be_within(5).of(new_valid_to)
|
||||
domain.outzone_at.should be_within(5).of(new_outzone_at)
|
||||
domain.delete_at.should be_within(5).of(new_delete_at)
|
||||
domain.valid_to.should be_within(5).of(old_valid_to + 1.year)
|
||||
domain.outzone_at.should be_within(5).of(old_valid_to + 1.year + Setting.expire_warning_period.days)
|
||||
domain.delete_at.should be_within(5).of(
|
||||
old_valid_to + 1.year + Setting.expire_warning_period.days + Setting.redemption_grace_period.days
|
||||
)
|
||||
end
|
||||
|
||||
it 'does not renew foreign domain' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue