mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Merge branch 'master' of github.com:domify/registry
This commit is contained in:
commit
a262e1e708
8 changed files with 45 additions and 16 deletions
|
@ -28,7 +28,7 @@ class Ability
|
|||
can(:info, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || pw.blank? ? true : d.auth_info == pw }
|
||||
can(:check, Epp::Domain)
|
||||
can(:create, Epp::Domain)
|
||||
can(:renew, Epp::Domain)
|
||||
can(:renew, Epp::Domain) { |d| d.registrar_id == @user.registrar_id }
|
||||
can(:update, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw }
|
||||
can(:transfer, Epp::Domain) { |d, pw| d.auth_info == pw }
|
||||
can(:view_password, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw }
|
||||
|
|
|
@ -148,10 +148,10 @@ class Contact < ActiveRecord::Base
|
|||
end
|
||||
# rubocop:enable Metrics/CyclomaticComplexity
|
||||
|
||||
# used only for contact trasphere
|
||||
# used only for contact transfer
|
||||
def generate_new_code!
|
||||
return nil if registrar.blank?
|
||||
registrar.reload # for contact transfere
|
||||
registrar.reload # for contact transfer
|
||||
self[:code] = "#{registrar.code}:#{SecureRandom.hex(4)}".upcase
|
||||
end
|
||||
|
||||
|
|
|
@ -467,7 +467,8 @@ class Epp::Domain < Domain
|
|||
oc = c.deep_clone include: [:statuses]
|
||||
oc.code = nil
|
||||
oc.registrar_id = registrar_id
|
||||
oc.save!
|
||||
oc.prefix_code
|
||||
oc.save!(validate: false)
|
||||
oc
|
||||
end
|
||||
|
||||
|
@ -475,7 +476,7 @@ class Epp::Domain < Domain
|
|||
oc = Contact.find(contact_id) # n+1 workaround
|
||||
oc.registrar_id = registrar_id
|
||||
oc.generate_new_code!
|
||||
oc.save!
|
||||
oc.save!(validate: false)
|
||||
oc
|
||||
end
|
||||
|
||||
|
@ -548,8 +549,9 @@ class Epp::Domain < Domain
|
|||
save!(validate: false)
|
||||
|
||||
return dt
|
||||
rescue => _e
|
||||
rescue => e
|
||||
add_epp_error('2306', nil, nil, I18n.t('action_failed_due_to_server_error'))
|
||||
logger.error('DOMAIN TRANSFER FAILED')
|
||||
logger.error(e)
|
||||
raise ActiveRecord::Rollback
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue