mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Merge branch 'master' of github.com:domify/registry
This commit is contained in:
commit
81d704e4f5
6 changed files with 25 additions and 0 deletions
|
@ -5,10 +5,12 @@ class DomainDeleteConfirmJob < Que::Job
|
|||
domain = Epp::Domain.find(domain_id)
|
||||
case action
|
||||
when RegistrantVerification::CONFIRMED
|
||||
domain.poll_message!(:poll_pending_delete_confirmed_by_registrant)
|
||||
domain.apply_pending_delete!
|
||||
domain.clean_pendings!
|
||||
when RegistrantVerification::REJECTED
|
||||
DomainMailer.pending_delete_rejected_notification(domain).deliver_now
|
||||
domain.poll_message!(:poll_pending_delete_rejected_by_registrant)
|
||||
domain.clean_pendings!
|
||||
end
|
||||
destroy # it's best to destroy the job in the same transaction
|
||||
|
|
|
@ -5,10 +5,12 @@ class DomainUpdateConfirmJob < Que::Job
|
|||
domain = Epp::Domain.find(domain_id)
|
||||
case action
|
||||
when RegistrantVerification::CONFIRMED
|
||||
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
|
||||
domain.apply_pending_update!
|
||||
domain.clean_pendings!
|
||||
when RegistrantVerification::REJECTED
|
||||
DomainMailer.pending_update_rejected_notification_for_new_registrant(domain).deliver_now
|
||||
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
|
||||
domain.clean_pendings!
|
||||
end
|
||||
destroy # it's best to destroy the job in the same transaction
|
||||
|
|
|
@ -348,6 +348,14 @@ class Domain < ActiveRecord::Base
|
|||
true
|
||||
end
|
||||
|
||||
def poll_message!(message_key)
|
||||
registrar.messages.create!(
|
||||
body: "#{I18n.t(message_key)}: #{name}",
|
||||
attached_obj_id: id,
|
||||
attached_obj_type: self.class.to_s
|
||||
)
|
||||
end
|
||||
|
||||
def preclean_pendings
|
||||
self.registrant_verification_token = nil
|
||||
self.registrant_verification_asked_at = nil
|
||||
|
|
|
@ -74,3 +74,5 @@ module Registry
|
|||
}
|
||||
end
|
||||
end
|
||||
|
||||
require 'validates_email_format_of'
|
||||
|
|
|
@ -899,3 +899,8 @@ en:
|
|||
new_zone: 'New zone'
|
||||
edit_zone: 'Edit zone'
|
||||
there_are_count_domains_in_this_zone: 'There are %{count} domains in this zone'
|
||||
poll_pending_update_confirmed_by_registrant: 'Registrant confirmed domain update'
|
||||
poll_pending_update_rejected_by_registranti: 'Registrant rejected domain update'
|
||||
poll_pending_delete_rejected_by_registrant: 'Registrant rejected domain deletion'
|
||||
poll_pending_delete_confirmed_by_registrant: 'Registrant confirmed domain deletion'
|
||||
|
||||
|
|
|
@ -418,6 +418,12 @@ describe Domain do
|
|||
@domain.statuses = DomainStatus::OK # restore
|
||||
end
|
||||
|
||||
it 'should add poll message to registrar' do
|
||||
domain = Fabricate(:domain, name: 'testpollmessage123.ee')
|
||||
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
|
||||
domain.registrar.messages.first.body.should == 'Registrant confirmed domain update: testpollmessage123.ee'
|
||||
end
|
||||
|
||||
context 'about registrant update confirm' do
|
||||
before :all do
|
||||
@domain.registrant_verification_token = 123
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue