mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Merge pull request #2215 from internetee/not-return-privately-owner-registrations
HOTFIX: if no companies there, should return an empty array
This commit is contained in:
commit
05d39ede28
1 changed files with 4 additions and 4 deletions
|
@ -25,10 +25,12 @@ class RegistrantUser < User
|
|||
|
||||
companies = update_contacts_before_receive(companies)
|
||||
companies
|
||||
rescue CompanyRegister::NotAvailableError
|
||||
return []
|
||||
end
|
||||
|
||||
def update_contacts_before_receive(companies)
|
||||
return if companies.blank?
|
||||
return [] if companies.blank?
|
||||
|
||||
companies.each do |company|
|
||||
contacts = Contact.where(ident: company.registration_number, ident_country_code: 'EE')
|
||||
|
@ -42,9 +44,7 @@ class RegistrantUser < User
|
|||
end
|
||||
end
|
||||
|
||||
return companies
|
||||
rescue CompanyRegister::NotAvailableError
|
||||
nil
|
||||
companies
|
||||
end
|
||||
|
||||
def update_company_name(contact:, company:)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue