mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Honor CID and new format independently
This commit is contained in:
parent
0a07004633
commit
ba26ea4bac
5 changed files with 11 additions and 39 deletions
|
@ -59,7 +59,7 @@ class Epp::ContactsController < EppController
|
|||
end
|
||||
|
||||
def find_contact
|
||||
code = params[:parsed_frame].css('id').text.strip.upcase.sub(/^CID:/, '')
|
||||
code = params[:parsed_frame].css('id').text.strip.upcase
|
||||
|
||||
@contact = Epp::Contact.find_by_epp_code(code)
|
||||
|
||||
|
|
|
@ -118,7 +118,6 @@ class Contact < ActiveRecord::Base
|
|||
# custom code from client
|
||||
# add prefix when needed
|
||||
if code.present?
|
||||
code.sub!(/^CID:/, '')
|
||||
prefix, *custom_code = code.split(':')
|
||||
code = custom_code.join(':') if prefix == registrar.code
|
||||
end
|
||||
|
|
|
@ -8,7 +8,8 @@ class Epp::Contact < Contact
|
|||
class << self
|
||||
# support legacy search
|
||||
def find_by_epp_code(code)
|
||||
find_by(code: code.sub(/^CID:/, ''))
|
||||
# find_by(code: code.sub(/^CID:/, '')) # legacy support turned off
|
||||
find_by(code: code)
|
||||
end
|
||||
|
||||
# rubocop: disable Metrics/PerceivedComplexity
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue