From a3ab2234c07e0108bb773795d603614dcce06dbc Mon Sep 17 00:00:00 2001 From: stvnrlly Date: Mon, 27 Feb 2023 15:45:35 -0500 Subject: [PATCH] delete letters from app/notifications --- .../process_letter_notifications.py | 37 ------------------- app/notifications/process_notifications.py | 12 ------ 2 files changed, 49 deletions(-) delete mode 100644 app/notifications/process_letter_notifications.py diff --git a/app/notifications/process_letter_notifications.py b/app/notifications/process_letter_notifications.py deleted file mode 100644 index ba99b4805..000000000 --- a/app/notifications/process_letter_notifications.py +++ /dev/null @@ -1,37 +0,0 @@ -from notifications_utils.postal_address import PostalAddress - -from app import create_random_identifier -from app.models import LETTER_TYPE -from app.notifications.process_notifications import persist_notification - - -def create_letter_notification( - letter_data, - template, - service, - api_key, - status, - reply_to_text=None, - billable_units=None, - updated_at=None, -): - notification = persist_notification( - template_id=template.id, - template_version=template.version, - # we only accept addresses_with_underscores from the API (from CSV we also accept dashes, spaces etc) - recipient=PostalAddress.from_personalisation(letter_data['personalisation']).normalised, - service=service, - personalisation=letter_data['personalisation'], - notification_type=LETTER_TYPE, - api_key_id=api_key.id, - key_type=api_key.key_type, - job_id=None, - job_row_number=None, - reference=create_random_identifier(), - client_reference=letter_data.get('reference'), - status=status, - reply_to_text=reply_to_text, - billable_units=billable_units, - updated_at=updated_at - ) - return notification diff --git a/app/notifications/process_notifications.py b/app/notifications/process_notifications.py index 1afd7b90b..d9d588dd7 100644 --- a/app/notifications/process_notifications.py +++ b/app/notifications/process_notifications.py @@ -10,7 +10,6 @@ from notifications_utils.recipients import ( validate_and_format_phone_number, ) from notifications_utils.template import ( - LetterPrintTemplate, PlainTextEmailTemplate, SMSMessageTemplate, ) @@ -25,7 +24,6 @@ from app.dao.notifications_dao import ( from app.models import ( EMAIL_TYPE, KEY_TYPE_TEST, - LETTER_TYPE, NOTIFICATION_CREATED, SMS_TYPE, Notification, @@ -56,16 +54,6 @@ def create_content_for_notification(template, personalisation): }, personalisation, ) - if template.template_type == LETTER_TYPE: - template_object = LetterPrintTemplate( - { - 'content': template.content, - 'subject': template.subject, - 'template_type': template.template_type, - }, - personalisation, - contact_block=template.reply_to_text, - ) check_placeholders(template_object)