mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
add postage to notification + noti_history
if it's a letter notification, postage must equal "first" or "second", else it must equal null
This commit is contained in:
@@ -178,7 +178,8 @@ def create_notification(
|
||||
one_off=False,
|
||||
sms_sender_id=None,
|
||||
reply_to_text=None,
|
||||
created_by_id=None
|
||||
created_by_id=None,
|
||||
postage=None
|
||||
):
|
||||
if created_at is None:
|
||||
created_at = datetime.utcnow()
|
||||
@@ -196,6 +197,9 @@ def create_notification(
|
||||
if not api_key:
|
||||
api_key = create_api_key(template.service, key_type=key_type)
|
||||
|
||||
if template.template_type == 'letter' and postage is None:
|
||||
postage = 'second'
|
||||
|
||||
data = {
|
||||
'id': uuid.uuid4(),
|
||||
'to': to_field,
|
||||
@@ -224,7 +228,8 @@ def create_notification(
|
||||
'phone_prefix': phone_prefix,
|
||||
'normalised_to': normalised_to,
|
||||
'reply_to_text': reply_to_text,
|
||||
'created_by_id': created_by_id
|
||||
'created_by_id': created_by_id,
|
||||
'postage': postage
|
||||
}
|
||||
notification = Notification(**data)
|
||||
dao_create_notification(notification)
|
||||
|
||||
Reference in New Issue
Block a user