mirror of
https://github.com/internetee/registry.git
synced 2025-07-19 17:25:57 +02:00
new contact honors new format
This commit is contained in:
parent
ede71f8e61
commit
3fb9664e5b
9 changed files with 133 additions and 113 deletions
|
@ -51,20 +51,9 @@ class Epp::Contact < Contact
|
|||
def new(frame, registrar)
|
||||
return super if frame.blank?
|
||||
|
||||
custom_code = frame.css('id').text
|
||||
|
||||
# add prefix when needed
|
||||
if custom_code.present?
|
||||
custom_code.sub!(/^CID:/, '')
|
||||
prefix = custom_code.split(':').first
|
||||
custom_code = "#{registrar.code}:#{custom_code}" if prefix != registrar.code
|
||||
custom_code = nil if custom_code == registrar.code
|
||||
custom_code.upcase! if custom_code.present?
|
||||
end
|
||||
|
||||
super(
|
||||
attrs_from(frame).merge(
|
||||
code: custom_code,
|
||||
code: frame.css('id').text,
|
||||
registrar: registrar
|
||||
)
|
||||
)
|
||||
|
|
|
@ -448,9 +448,8 @@ class Epp::Domain < Domain
|
|||
|
||||
def transfer_contact(contact_id, registrar_id)
|
||||
oc = Contact.find(contact_id) # n+1 workaround
|
||||
oc.code_overwrite_allowed = true
|
||||
oc.generate_code
|
||||
oc.registrar_id = registrar_id
|
||||
oc.generate_new_code!
|
||||
oc.save!
|
||||
oc
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue