Skip to content

Commit

Permalink
update logic to get corp_name for amalg and IA and fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
eason-pan-bc committed Nov 15, 2024
1 parent de18722 commit dec0e0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ def _get_pdfs(
)
attach_order += 1

corp_name = business.get('legalName')
# add receipt
if not (corp_name := business.get('legalName')): # pylint: disable=superfluous-parens
legal_type = business.get('legalType')
corp_name = Business.BUSINESSES.get(legal_type, {}).get('numberedDescription')

receipt = requests.post(
f'{current_app.config.get("PAY_API_URL")}/{filing.payment_token}/receipts',
json={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ def _get_pdfs(
attach_order += 1

# add receipt
if not (corp_name := business.get('legalName')):
if not (corp_name := business.get('legalName')): # pylint: disable=superfluous-parens
legal_type = business.get('legalType')
corp_name = Business.BUSINESSES.get(legal_type, {}).get('numberedDescription')

# Debugging logger for #24361, will have another PR before closing the ticket to remove it
current_app.logger.debug(
f'\U0001F4D2 - Business: {business}\n'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,11 @@ def _get_pdfs(
}
)
attach_order += 1

# add receipt pdf
if filing.filing_type == 'incorporationApplication':
corp_name = filing.filing_json['filing']['incorporationApplication']['nameRequest'].get(
'legalName', 'Numbered Company')
else:
corp_name = business.get('legalName')
if not (corp_name := business.get('legalName')): # pylint: disable=superfluous-parens
legal_type = business.get('legalType')
corp_name = Business.BUSINESSES.get(legal_type, {}).get('numberedDescription')

receipt = requests.post(
f'{current_app.config.get("PAY_API_URL")}/{filing.payment_token}/receipts',
Expand Down

0 comments on commit dec0e0b

Please sign in to comment.