From a643bf6a24cd54484319f4e70a992d82f57e7c28 Mon Sep 17 00:00:00 2001 From: semmatti Date: Mon, 29 Apr 2024 09:52:10 -0700 Subject: [PATCH] don't send an attachment with consent received emails --- .../resources/name_requests/report_resource.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/api/namex/resources/name_requests/report_resource.py b/api/namex/resources/name_requests/report_resource.py index f94e261af..bed11fb5a 100644 --- a/api/namex/resources/name_requests/report_resource.py +++ b/api/namex/resources/name_requests/report_resource.py @@ -42,9 +42,6 @@ def email_consent_letter(self, nr_id): if not nr_model: return jsonify(message='{nr_id} not found'.format(nr_id=nr_model.id)), HTTPStatus.NOT_FOUND nr_model.consentFlag = 'R' # invariant: this function is only called when the consent letter has been received - report, status_code = ReportResource._get_report(nr_model) - if status_code != HTTPStatus.OK: - return jsonify(message=str(report)), status_code report_name = nr_model.nrNum + ' - ' + CONSENT_EMAIL_SUBJECT recipient_emails = [] for applicant in nr_model.applicants: @@ -59,20 +56,12 @@ def email_consent_letter(self, nr_id): file_name = f"{file_name}-{instruction_group}" email_template = Path(f'{template_path}/emails/{file_name}.md').read_text() email_body = ReportResource._build_email_body(email_template, nr_model) - attachments = [ - { - 'fileName': report_name.replace(' - ', ' ').replace(' ', '_') + '.pdf', - 'fileBytes': base64.b64encode(report).decode(), - 'fileUrl': '', - 'attachOrder': 1 - } - ] email = { 'recipients': recipients, 'content': { 'subject': report_name, 'body': email_body, - 'attachments': attachments + 'attachments': [] } } return ReportResource._send_email(email)