give letter notifications the postage from their service

This commit is contained in:
Leo Hemsted
2018-09-19 16:39:39 +01:00
parent 9021b43eb6
commit 4dc3f829e3
5 changed files with 60 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ from app.models import (
EMAIL_TYPE,
KEY_TYPE_TEST,
SMS_TYPE,
LETTER_TYPE,
NOTIFICATION_CREATED,
Notification,
ScheduledNotification
@@ -105,6 +106,8 @@ def persist_notification(
notification.rate_multiplier = recipient_info.billable_units
elif notification_type == EMAIL_TYPE:
notification.normalised_to = format_email_address(notification.to)
elif notification_type == LETTER_TYPE:
notification.postage = service.postage
# if simulated create a Notification model to return but do not persist the Notification to the dB
if not simulated: