Skip to content

Commit

Permalink
remain sr correction consistent with Entities correction filing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jxio committed Aug 21, 2023
1 parent 87a1e24 commit ea0712d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions legal-api/src/legal_api/core/meta/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,11 @@ def get_corrected_filing_name(filing: FilingStorage, business_revision: Business
corrected_filing_type = filing.filing_json['filing']['correction']['correctedFilingType']
corrected_filing_id = filing.filing_json['filing']['correction']['correctedFilingId']

if corrected_filing_type in ['annualReport', 'specialResolution']:
if corrected_filing_type in ['annualReport']:
corrected_filing = FilingStorage.find_by_id(corrected_filing_id)
display_name = FilingMeta.display_name(business_revision, corrected_filing)
if corrected_filing_type == 'annualReport':
return f'Correction - {display_name}'
else:
return f'{display_name} Correction'
elif corrected_filing_type == 'correction':
corrected_filing = FilingStorage.find_by_id(corrected_filing_id)
return FilingMeta.get_corrected_filing_name(corrected_filing, business_revision, name)
Expand Down
3 changes: 0 additions & 3 deletions legal-api/src/legal_api/reports/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ def _get_template_filename(self):
# Get template specific to legal type
file_name = None
specific_template = ReportMeta.reports[self._report_key].get(self._business.legal_type, None)
if self._business.legal_type == 'CP' and self._filing.filing_type == 'correction':
if is_special_resolution_correction_by_meta_data(self._filing):
file_name = 'specialResolutionCorrectionApplication'
if file_name is None:
# Fallback to default if specific template not found
file_name = specific_template['fileName'] if specific_template else \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def test_ledger_display_special_resolution_correction(session, client, jwt):
assert rv.json['filings']
for filing_json in rv.json['filings']:
if filing_json['name'] == 'correction':
assert filing_json['displayName'] == 'Special Resolution Correction'
assert filing_json['displayName'] == 'Register Correction Application'
elif filing_json['name'] == 'specialResolution':
assert filing_json['displayName'] == 'Special Resolution'
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def _get_pdfs(
filing_pdf_encoded = base64.b64encode(filing_pdf.content)
pdfs.append(
{
'fileName': 'Special Resolution Correction Application.pdf' if is_cp_special_resolution else
'Register Correction Application.pdf',
'fileName': 'Register Correction Application.pdf',
'fileBytes': filing_pdf_encoded.decode('utf-8'),
'fileUrl': '',
'attachOrder': attach_order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_paid_special_resolution_correction_attachments(session, config):
assert 'content' in output
assert 'attachments' in output['content']
assert len(output['content']['attachments']) == 2
assert output['content']['attachments'][0]['fileName'] == 'Special Resolution Correction Application.pdf'
assert output['content']['attachments'][0]['fileName'] == 'Register Correction Application.pdf'
assert base64.b64decode(output['content']['attachments'][0]['fileBytes']).decode('utf-8') == 'pdf_content_1'
assert output['content']['attachments'][1]['fileName'] == 'Receipt.pdf'
assert base64.b64decode(output['content']['attachments'][1]['fileBytes']).decode('utf-8') == 'pdf_content_2'
Expand Down

0 comments on commit ea0712d

Please sign in to comment.