Skip to content

Commit

Permalink
ops bug fix for businesses with parties with data issues (#1509)
Browse files Browse the repository at this point in the history
Signed-off-by: Kial Jinnah <kialj876@gmail.com>
  • Loading branch information
kialj876 authored Jan 19, 2024
1 parent f8cf4af commit 26c9de9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions solr-feeder/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ REGISTRIES_SEARCH_API_INTERNAL_URL=
BOR_API_INTERNAL_URL=

# Service Account
KEYCLOAK_AUTH_TOKEN_URL=https://dev.oidc.gov.bc.ca/auth/realms/bcregistry/protocol/openid-connect/token
BUSINESS_SEARCH_SERVICE_ACCOUNT_CLIENT_ID=nds-service-account
BUSINESS_SEARCH_SERVICE_ACCOUNT_SECRET=
KEYCLOAK_AUTH_TOKEN_URL=https://dev.loginproxy.gov.bc.ca/auth/realms/bcregistry/protocol/openid-connect/token
NDS_SERVICE_ACCOUNT_CLIENT_ID=nds-service-account
NDS_SERVICE_ACCOUNT_SECRET=
9 changes: 8 additions & 1 deletion solr-feeder/solr_feeder/services/colin.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,14 @@ def get_parties(legal_type: str, identifier: str, token: str) -> tuple[list[dict
if roles:
# has valid roles so add party to update
party['roles'] = roles
parties.append(_parse_party(party, legal_type))
if parsed_party := _parse_party(party, legal_type):
# check to make sure it contains a person name (otherwise we will ignore this record)
# - NOTE: some records contain no organization name AND no party name
has_person_name = parsed_party['officer'].get('firstName') \
or parsed_party['officer'].get('middleInitial') \
or parsed_party['officer'].get('lastName')
if has_person_name:
parties.append(parsed_party)

return parties, None

Expand Down
2 changes: 1 addition & 1 deletion solr-feeder/solr_feeder/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
Development release segment: .devN
"""

__version__ = '2.0.7' # pylint: disable=invalid-name
__version__ = '2.0.8' # pylint: disable=invalid-name

0 comments on commit 26c9de9

Please sign in to comment.