From ea0712d9a6e824d098d764581411988b1d7a9890 Mon Sep 17 00:00:00 2001 From: Jia Xu Date: Mon, 21 Aug 2023 15:46:41 -0700 Subject: [PATCH] remain sr correction consistent with Entities correction filing --- legal-api/src/legal_api/core/meta/filing.py | 4 +--- legal-api/src/legal_api/reports/report.py | 3 --- .../resources/v2/test_business_filings/test_filings_ledger.py | 2 +- .../email_processors/correction_notification.py | 3 +-- .../unit/email_processors/test_correction_notification.py | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/legal-api/src/legal_api/core/meta/filing.py b/legal-api/src/legal_api/core/meta/filing.py index 59b14e6418..d036bcd74c 100644 --- a/legal-api/src/legal_api/core/meta/filing.py +++ b/legal-api/src/legal_api/core/meta/filing.py @@ -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) diff --git a/legal-api/src/legal_api/reports/report.py b/legal-api/src/legal_api/reports/report.py index 6a507295e7..9c9577660e 100644 --- a/legal-api/src/legal_api/reports/report.py +++ b/legal-api/src/legal_api/reports/report.py @@ -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 \ diff --git a/legal-api/tests/unit/resources/v2/test_business_filings/test_filings_ledger.py b/legal-api/tests/unit/resources/v2/test_business_filings/test_filings_ledger.py index 846bca1236..bf29024120 100644 --- a/legal-api/tests/unit/resources/v2/test_business_filings/test_filings_ledger.py +++ b/legal-api/tests/unit/resources/v2/test_business_filings/test_filings_ledger.py @@ -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: diff --git a/queue_services/entity-emailer/src/entity_emailer/email_processors/correction_notification.py b/queue_services/entity-emailer/src/entity_emailer/email_processors/correction_notification.py index 773c296a89..7e3ad602ba 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_processors/correction_notification.py +++ b/queue_services/entity-emailer/src/entity_emailer/email_processors/correction_notification.py @@ -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 diff --git a/queue_services/entity-emailer/tests/unit/email_processors/test_correction_notification.py b/queue_services/entity-emailer/tests/unit/email_processors/test_correction_notification.py index 81eda1650e..5b2b0f6a82 100644 --- a/queue_services/entity-emailer/tests/unit/email_processors/test_correction_notification.py +++ b/queue_services/entity-emailer/tests/unit/email_processors/test_correction_notification.py @@ -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'