mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 23:54:44 +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 = update_contacts_before_receive(companies)
|
||||||
companies
|
companies
|
||||||
|
rescue CompanyRegister::NotAvailableError
|
||||||
|
return []
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_contacts_before_receive(companies)
|
def update_contacts_before_receive(companies)
|
||||||
return if companies.blank?
|
return [] if companies.blank?
|
||||||
|
|
||||||
companies.each do |company|
|
companies.each do |company|
|
||||||
contacts = Contact.where(ident: company.registration_number, ident_country_code: 'EE')
|
contacts = Contact.where(ident: company.registration_number, ident_country_code: 'EE')
|
||||||
|
@ -42,9 +44,7 @@ class RegistrantUser < User
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return companies
|
companies
|
||||||
rescue CompanyRegister::NotAvailableError
|
|
||||||
nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_company_name(contact:, company:)
|
def update_company_name(contact:, company:)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue