mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
commit
68faff40cc
10 changed files with 87 additions and 93 deletions
|
@ -1,6 +1,6 @@
|
|||
class Registrant::DomainUpdateConfirmsController < RegistrantController
|
||||
skip_before_action :authenticate_user!, only: [:show, :update]
|
||||
skip_authorization_check only: [:show, :update]
|
||||
skip_before_action :authenticate_user!, only: %i[show update]
|
||||
skip_authorization_check only: %i[show update]
|
||||
|
||||
def show
|
||||
return if params[:confirmed] || params[:rejected]
|
||||
|
|
|
@ -23,7 +23,9 @@ class DomainUpdateConfirmJob < Que::Job
|
|||
registrant: domain.registrant).deliver_now
|
||||
|
||||
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
|
||||
domain.clean_pendings_lowlevel
|
||||
|
||||
domain.preclean_pendings
|
||||
domain.clean_pendings!
|
||||
end
|
||||
destroy # it's best to destroy the job in the same transaction
|
||||
end
|
||||
|
|
|
@ -294,36 +294,6 @@ class Domain < ActiveRecord::Base
|
|||
save
|
||||
end
|
||||
|
||||
|
||||
# state changes may be done low-level - no validation
|
||||
# in this metod we still save PaperTrail log.
|
||||
def clean_pendings_lowlevel
|
||||
statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||
|
||||
status_notes[DomainStatus::PENDING_UPDATE] = ''
|
||||
status_notes[DomainStatus::PENDING_DELETE] = ''
|
||||
|
||||
hash = {
|
||||
registrant_verification_token: nil,
|
||||
registrant_verification_asked_at: nil,
|
||||
pending_json: {},
|
||||
status_notes: status_notes,
|
||||
statuses: statuses.presence || [DomainStatus::OK],
|
||||
# need this column in order to update PaperTrail version properly
|
||||
updated_at: Time.now.utc
|
||||
}
|
||||
|
||||
# PaperTrail
|
||||
self.attributes = hash
|
||||
record_update
|
||||
clear_version_instance!
|
||||
reset_transaction_id
|
||||
|
||||
update_columns(hash)
|
||||
end
|
||||
|
||||
def pending_update!
|
||||
return true if pending_update?
|
||||
self.epp_pending_update = true # for epp
|
||||
|
|
|
@ -21,7 +21,10 @@ class DomainCron
|
|||
if domain.pending_delete? || domain.pending_delete_confirmation?
|
||||
DomainMailer.pending_delete_expired_notification(domain.id, true).deliver
|
||||
end
|
||||
domain.clean_pendings_lowlevel
|
||||
|
||||
domain.preclean_pendings
|
||||
domain.clean_pendings!
|
||||
|
||||
unless Rails.env.test?
|
||||
STDOUT << "#{Time.zone.now.utc} DomainCron.clean_expired_pendings: ##{domain.id} (#{domain.name})\n"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue