mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Honor legacy contact codes
This commit is contained in:
parent
8b22c58eec
commit
834d638423
6 changed files with 74 additions and 47 deletions
|
@ -51,12 +51,15 @@ class Epp::Contact < Contact
|
|||
def new(frame, registrar)
|
||||
return super if frame.blank?
|
||||
|
||||
custom_code =
|
||||
if frame.css('id').text.present?
|
||||
"#{registrar.code}:#{frame.css('id').text.parameterize}"
|
||||
else
|
||||
nil
|
||||
custom_code = frame.css('id').text
|
||||
|
||||
# add prefix when needed
|
||||
if custom_code.present?
|
||||
prefix, custom = custom_code.split(':')
|
||||
if prefix != registrar.code && custom != registrar.code
|
||||
custom_code = "#{registrar.code}:#{custom_code}"
|
||||
end
|
||||
end
|
||||
|
||||
super(
|
||||
attrs_from(frame).merge(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue