mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Merge pull request #3087 from alphagov/migrate-broadcast
add content to old broadcast messages with no content
This commit is contained in:
@@ -189,19 +189,12 @@ def _create_broadcast_event(broadcast_message):
|
||||
else:
|
||||
transmitted_finishes_at = broadcast_message.finishes_at
|
||||
|
||||
# TODO: Remove this if statement after broadcast message content is guaranteed to always be populated.
|
||||
if broadcast_message.content:
|
||||
content = broadcast_message.content
|
||||
else:
|
||||
content = broadcast_message.template._as_utils_template_with_personalisation(
|
||||
broadcast_message.personalisation
|
||||
).content_with_placeholders_filled_in
|
||||
|
||||
event = BroadcastEvent(
|
||||
service=broadcast_message.service,
|
||||
broadcast_message=broadcast_message,
|
||||
message_type=msg_types[broadcast_message.status],
|
||||
transmitted_content={"body": content},
|
||||
transmitted_content={"body": broadcast_message.content},
|
||||
transmitted_areas=broadcast_message.areas,
|
||||
# TODO: Probably move this somewhere more standalone too and imply that it shouldn't change. Should it include
|
||||
# a service based identifier too? eg "flood-warnings@notifications.service.gov.uk" or similar
|
||||
|
||||
Reference in New Issue
Block a user