mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
Contact: Append prefix unless present
This commit is contained in:
parent
1bdfcef36b
commit
c7b4045018
2 changed files with 8 additions and 4 deletions
|
@ -93,7 +93,11 @@ module Epp
|
|||
|
||||
def find_contact
|
||||
code = params[:parsed_frame].css('id').text.strip.upcase
|
||||
@contact = Epp::Contact.find_by!(code: code)
|
||||
reg_code = current_user.registrar.code.upcase
|
||||
arr = [code, "#{reg_code}:#{code}", "CID:#{code}", "CID:#{reg_code}:#{code}"]
|
||||
|
||||
contact = arr.find { |c| Epp::Contact.find_by(code: c).present? }
|
||||
@contact = Epp::Contact.find_by!(code: contact || code)
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue