diff --git a/app/controllers/registrant/contacts_controller.rb b/app/controllers/registrant/contacts_controller.rb index 136596ede..49070ebde 100644 --- a/app/controllers/registrant/contacts_controller.rb +++ b/app/controllers/registrant/contacts_controller.rb @@ -6,7 +6,7 @@ class Registrant::ContactsController < RegistrantController before_action :set_contact, only: [:show] def show - @requester_contact = Contact.find_by(ident: current_registrant_user.ident).id + @requester_contact = Contact.find_by(ident: current_registrant_user.ident) authorize! :read, @contact end diff --git a/app/models/contact.rb b/app/models/contact.rb index 58d8b8c60..de97547b8 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -451,9 +451,8 @@ class Contact < ApplicationRecord end def qualified_domain_name_list(requester, filter_sql) - return Domain.where('domains.id IN (?)', filter_sql) if requester.nil? + return Domain.where('domains.id IN (?)', filter_sql) unless requester.present? - requester = Contact.find_by(id: requester) registrant_user = RegistrantUser.find_or_initialize_by(registrant_ident: "#{requester.ident_country_code}-#{requester.ident}") begin