mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
ruby syntaxt upadtes #2557
This commit is contained in:
parent
1b66e74108
commit
9c43e8e302
5 changed files with 13 additions and 15 deletions
|
@ -318,6 +318,7 @@ class Domain < ActiveRecord::Base
|
|||
pending_json[:domain] = changes_cache
|
||||
end
|
||||
|
||||
# rubocop: disable Metrics/CyclomaticComplexity
|
||||
def registrant_update_confirmable?(token)
|
||||
return true if Rails.env.development?
|
||||
return false unless pending_update?
|
||||
|
@ -337,6 +338,7 @@ class Domain < ActiveRecord::Base
|
|||
return false if registrant_verification_token != token
|
||||
true
|
||||
end
|
||||
# rubocop: enable Metrics/CyclomaticComplexity
|
||||
|
||||
def force_deletable?
|
||||
!statuses.include?(DomainStatus::FORCE_DELETE)
|
||||
|
@ -362,7 +364,7 @@ class Domain < ActiveRecord::Base
|
|||
self.epp_pending_delete = true # for epp
|
||||
|
||||
return true unless registrant_verification_asked?
|
||||
statuses = [DomainStatus::PENDING_DELETE]
|
||||
self.statuses = [DomainStatus::PENDING_DELETE]
|
||||
save(validate: false) # should check if this did succeed
|
||||
|
||||
DomainMailer.pending_deleted(self).deliver_now
|
||||
|
|
|
@ -369,7 +369,9 @@ class Epp::Domain < Domain
|
|||
at[:admin_domain_contacts_attributes] += at_add[:admin_domain_contacts_attributes]
|
||||
at[:tech_domain_contacts_attributes] += at_add[:tech_domain_contacts_attributes]
|
||||
at[:dnskeys_attributes] += at_add[:dnskeys_attributes]
|
||||
at[:statuses] = statuses - domain_statuses_attrs(frame.css('rem'), 'rem') + domain_statuses_attrs(frame.css('add'), 'add')
|
||||
at[:statuses] =
|
||||
statuses - domain_statuses_attrs(frame.css('rem'), 'rem') + domain_statuses_attrs(frame.css('add'), 'add')
|
||||
|
||||
# at[:statuses] += at_add[:domain_statuses_attributes]
|
||||
|
||||
if verify && frame.css('registrant').present? && frame.css('registrant').attr('verified').to_s.downcase != 'yes'
|
||||
|
@ -385,9 +387,7 @@ class Epp::Domain < Domain
|
|||
frame = Nokogiri::XML(pending_json['frame'])
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
|
||||
if update(frame, user, false)
|
||||
clean_pendings!
|
||||
end
|
||||
clean_pendings! if update(frame, user, false)
|
||||
end
|
||||
|
||||
def attach_legal_document(legal_document_data)
|
||||
|
|
|
@ -17,16 +17,12 @@ class RegistrantVerification < ActiveRecord::Base
|
|||
def domain_registrant_change_confirm!
|
||||
self.action_type = DOMAIN_REGISTRANT_CHANGE
|
||||
self.action = CONFIRMED
|
||||
if save
|
||||
DomainConfirmJob.enqueue domain.id, CONFIRMED
|
||||
end
|
||||
DomainConfirmJob.enqueue domain.id, CONFIRMED if save
|
||||
end
|
||||
|
||||
def domain_registrant_change_reject!
|
||||
self.action_type = DOMAIN_REGISTRANT_CHANGE
|
||||
self.action = REJECTED
|
||||
if save
|
||||
DomainConfirmJob.enqueue domain.id, REJECTED
|
||||
end
|
||||
DomainConfirmJob.enqueue domain.id, REJECTED if save
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ class DeviseCustomFailure < Devise::FailureApp
|
|||
def redirect_url
|
||||
return registrant_login_url if request.original_fullpath.to_s.match(/^\/registrant/)
|
||||
return registrar_login_url if request.original_fullpath.to_s.match(/^\/registrar/)
|
||||
return '/admin' if request.original_fullpath.to_s.match(/^\/admin\/que/)
|
||||
return '/admin' if request.original_fullpath.to_s.match(%r{^\/admin\/que})
|
||||
return admin_login_url if request.original_fullpath.to_s.match(/^\/admin/)
|
||||
root_url
|
||||
end
|
||||
|
|
|
@ -235,6 +235,7 @@ namespace :import do
|
|||
legacy_contact_id
|
||||
)
|
||||
|
||||
# rubocop: disable Lint/UselessAssignment
|
||||
domain_status_columns = %w(
|
||||
description
|
||||
value
|
||||
|
@ -242,6 +243,7 @@ namespace :import do
|
|||
updator_str
|
||||
legacy_domain_id
|
||||
)
|
||||
# rubocop: enable Lint/UselessAssignment
|
||||
|
||||
nameserver_columns = %w(
|
||||
hostname
|
||||
|
@ -292,9 +294,7 @@ namespace :import do
|
|||
end
|
||||
|
||||
# OK status is default
|
||||
if ok
|
||||
domain_statuses << DomainStatus::OK
|
||||
end
|
||||
domain_statuses << DomainStatus::OK if ok
|
||||
|
||||
domains << [
|
||||
x.object_registry.name.try(:strip),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue