mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-24 09:58:43 -04:00
Sort broadcasts by start time
For emails and text messages we sort by the time the user (or API) sent them. This makes sense for broadcasts too, since most users will receive the alert within seconds of it being broadcast. For alerts that haven’t started yet we can sort by `updated_at`, which is when the user preparing the broadcast submitted it for approval.
This commit is contained in:
@@ -649,10 +649,12 @@ def broadcast_message_json(
|
||||
starts_at=None,
|
||||
finishes_at=None,
|
||||
cancelled_at=None,
|
||||
updated_at=None,
|
||||
approved_by_id=None,
|
||||
cancelled_by_id=None,
|
||||
areas=None,
|
||||
content=None,
|
||||
template_name='Example template',
|
||||
):
|
||||
return {
|
||||
'id': id_,
|
||||
@@ -661,7 +663,7 @@ def broadcast_message_json(
|
||||
|
||||
'template_id': template_id,
|
||||
'template_version': 123,
|
||||
'template_name': 'Example template',
|
||||
'template_name': template_name,
|
||||
'content': content or 'This is a test',
|
||||
|
||||
'personalisation': {},
|
||||
@@ -677,7 +679,7 @@ def broadcast_message_json(
|
||||
'created_at': None,
|
||||
'approved_at': None,
|
||||
'cancelled_at': cancelled_at,
|
||||
'updated_at': None,
|
||||
'updated_at': updated_at,
|
||||
|
||||
'created_by_id': created_by_id,
|
||||
'approved_by_id': approved_by_id,
|
||||
|
||||
Reference in New Issue
Block a user