mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 10:19:45 +02:00
Story #109367694 - use creator or updator as string, when registrar can not be found
This commit is contained in:
parent
251a9e1666
commit
098c40efc1
2 changed files with 16 additions and 4 deletions
|
@ -48,11 +48,17 @@ xml.epp_head do
|
|||
|
||||
xml.tag!('contact:clID', @contact.registrar.try(:code))
|
||||
|
||||
xml.tag!('contact:crID', @contact.creator.registrar.try(:code))
|
||||
# EPP requires a creator ID, which should be registrar code if we have one
|
||||
crID = contact.creator.try(:registrar)
|
||||
crID = crID.code if crID.present? # Did creator return a kind of User that has a registrar?
|
||||
crID = contact.creator unless crID.present? # Fallback if we failed, maybe this is a string only
|
||||
xml.tag!('contact:crID', crID)
|
||||
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
|
||||
|
||||
if @contact.updated_at != @contact.created_at
|
||||
xml.tag!('contact:upID', @contact.updator.registrar.code) if @contact.updator.try(:registrar).present?
|
||||
upID = contact.updator.try(:registrar)
|
||||
upID = upID.code if upID.present? # Did updator return a kind of User that has a registrar?
|
||||
xml.tag!('contact:upID', upID) if upID.present? # optional upID
|
||||
xml.tag!('contact:upDate', @contact.updated_at.try(:iso8601))
|
||||
end
|
||||
# xml.tag!('contact:trDate', '123') if false
|
||||
|
|
|
@ -38,11 +38,17 @@ xml.epp_head do
|
|||
|
||||
xml.tag!('domain:clID', @domain.registrar.code)
|
||||
|
||||
xml.tag!('domain:crID', @domain.creator.registrar.code) if @domain.creator
|
||||
# EPP requires a creator ID, which should be registrar code if we have one
|
||||
crID = @domain.creator.try(:registrar)
|
||||
crID = crID.code if crID.present? # Did creator return a kind of User that has a registrar?
|
||||
crID = @domain.creator unless crID.present? # Fallback if we failed, maybe this is a string only
|
||||
xml.tag!('domain:crID', crID)
|
||||
xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
|
||||
|
||||
if @domain.updated_at != @domain.created_at
|
||||
xml.tag!('domain:upID', @domain.updator.registrar.code) if @domain.updator.try(:registrar).present?
|
||||
upID = @domain.updator.try(:registrar)
|
||||
upID = upID.code if upID.present? # Did updator return a kind of User that has a registrar?
|
||||
xml.tag!('domain:upID', upID) if upID.present? # optional upID
|
||||
xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601))
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue