mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 00:41:35 -05:00
Require reference if template not provided
In the admin app we need something to use in show in lieu of template name when a template isn’t used. Let’s store this in the reference field for now.
This commit is contained in:
@@ -109,8 +109,9 @@ def create_broadcast_message(service_id):
|
||||
content = template._as_utils_template_with_personalisation(
|
||||
personalisation
|
||||
).content_with_placeholders_filled_in
|
||||
reference = None
|
||||
else:
|
||||
template, content = None, data['content']
|
||||
template, content, reference = None, data['content'], data['reference']
|
||||
|
||||
broadcast_message = BroadcastMessage(
|
||||
service_id=service.id,
|
||||
@@ -123,6 +124,7 @@ def create_broadcast_message(service_id):
|
||||
finishes_at=_parse_nullable_datetime(data.get('finishes_at')),
|
||||
created_by_id=user.id,
|
||||
content=content,
|
||||
reference=reference,
|
||||
)
|
||||
|
||||
dao_save_object(broadcast_message)
|
||||
|
||||
Reference in New Issue
Block a user