progress on removing postage

This commit is contained in:
stvnrlly
2023-02-10 15:04:59 -05:00
parent 590b3356a1
commit ff3f2c06c0
40 changed files with 189 additions and 798 deletions

View File

@@ -22,7 +22,6 @@ from app.notifications.process_notifications import (
)
from app.notifications.validators import (
check_service_over_daily_message_limit,
validate_address,
validate_and_format_recipient,
validate_template,
)
@@ -65,16 +64,7 @@ def send_one_off_notification(service_id, post_data):
notification_type=template.template_type,
allow_guest_list_recipients=False,
)
postage = None
client_reference = None
if template.template_type == LETTER_TYPE:
# Validate address and set postage to europe|rest-of-world if international letter,
# otherwise persist_notification with use template postage
postage = validate_address(service, personalisation)
if not postage:
postage = template.postage
from app.utils import get_reference_from_personalisation
client_reference = get_reference_from_personalisation(personalisation)
validate_created_by(service, post_data['created_by'])
@@ -97,7 +87,6 @@ def send_one_off_notification(service_id, post_data):
created_by_id=post_data['created_by'],
reply_to_text=reply_to,
reference=create_one_off_reference(template.template_type),
postage=postage,
client_reference=client_reference
)