Skip to content

Commit

Permalink
19043 foreign_corp_num to foreign_identifier (bcgov#2430) cherry pick…
Browse files Browse the repository at this point in the history
… fixes
  • Loading branch information
JazzarKarim committed Mar 18, 2024
1 parent f3327be commit d753aca
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typing import Dict

import sentry_sdk
from business_model import AmalgamatingBusiness, Amalgamation, Document, Filing, LegalEntity, RegistrationBootstrap, db
from legal_api.models import AmalgamatingBusiness, Amalgamation, Document, Filing, LegalEntity, RegistrationBootstrap, db

from entity_filer.exceptions import DefaultException
from entity_filer.filing_meta import FilingMeta
Expand Down Expand Up @@ -85,13 +85,13 @@ def create_amalgamating_businesses(amalgamation_filing: Dict, amalgamation: Amal
amalgamating_businesses_json = amalgamation_filing.get("amalgamatingBusinesses", [])
for amalgamating_business_json in amalgamating_businesses_json:
amalgamating_business = AmalgamatingBusiness()
amalgamating_business.role = amalgamating_business_json.get('role')
identifier = amalgamating_business_json.get('identifier')
if foreign_jurisdiction := amalgamating_business_json.get('foreignJurisdiction'):
amalgamating_business.role = amalgamating_business_json.get("role")
identifier = amalgamating_business_json.get("identifier")
if foreign_jurisdiction := amalgamating_business_json.get("foreignJurisdiction"):
amalgamating_business.foreign_identifier = identifier
amalgamating_business.foreign_name = amalgamating_business_json.get('legalName')
amalgamating_business.foreign_jurisdiction = foreign_jurisdiction.get('country').upper()
if region := foreign_jurisdiction.get('region'):
amalgamating_business.foreign_name = amalgamating_business_json.get("legalName")
amalgamating_business.foreign_jurisdiction = foreign_jurisdiction.get("country").upper()
if region := foreign_jurisdiction.get("region"):
amalgamating_business.foreign_jurisdiction_region = region.upper()
elif business := LegalEntity.find_by_identifier(identifier):
amalgamating_business.business_id = business.id
Expand Down

0 comments on commit d753aca

Please sign in to comment.