diff --git a/app/models/broadcast_message.py b/app/models/broadcast_message.py index 03677339c..c3efd2ed1 100644 --- a/app/models/broadcast_message.py +++ b/app/models/broadcast_message.py @@ -36,6 +36,13 @@ class BroadcastMessage(JSONModel): libraries = broadcast_area_libraries + def __lt__(self, other): + return ( + self.cancelled_at or self.finishes_at + ) < ( + other.cancelled_at or other.finishes_at + ) + @classmethod def create(cls, *, service_id, template_id): return cls(broadcast_message_api_client.create_broadcast_message( diff --git a/app/templates/views/broadcast/dashboard.html b/app/templates/views/broadcast/dashboard.html index 011bd756b..7a5267489 100644 --- a/app/templates/views/broadcast/dashboard.html +++ b/app/templates/views/broadcast/dashboard.html @@ -5,7 +5,7 @@ {% macro broadcast_table(broadcasts, empty_message) %}