mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
Skip company query if ident is eIDAS UUID
This commit is contained in:
parent
ea2f9dcbb6
commit
1999493bac
1 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,7 @@ class RegistrantUser < User
|
||||||
delegate :can?, :cannot?, to: :ability
|
delegate :can?, :cannot?, to: :ability
|
||||||
|
|
||||||
def ident
|
def ident
|
||||||
registrant_ident.to_s.slice(3)
|
registrant_ident.to_s[3..]
|
||||||
end
|
end
|
||||||
|
|
||||||
def country
|
def country
|
||||||
|
@ -18,6 +18,8 @@ class RegistrantUser < User
|
||||||
end
|
end
|
||||||
|
|
||||||
def companies(company_register = CompanyRegister::Client.new)
|
def companies(company_register = CompanyRegister::Client.new)
|
||||||
|
return [] if ident.include?('-')
|
||||||
|
|
||||||
company_register.representation_rights(citizen_personal_code: ident,
|
company_register.representation_rights(citizen_personal_code: ident,
|
||||||
citizen_country_code: country.alpha3)
|
citizen_country_code: country.alpha3)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue