From 283393024d7f8f1c4e920f07347a366b3fc6db37 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 19 Aug 2020 15:10:44 +0100 Subject: [PATCH] Fix pages which assume broadcasts have a finish time They no longer have a finish time until they have been approved. Previously it was the person preparing the broadcast who chose when it should finish. --- app/models/broadcast_message.py | 4 ++-- app/templates/views/broadcast/view-message.html | 3 --- tests/app/main/views/test_broadcast.py | 1 - tests/conftest.py | 1 + 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/models/broadcast_message.py b/app/models/broadcast_message.py index 769e36ebb..88eba53b0 100644 --- a/app/models/broadcast_message.py +++ b/app/models/broadcast_message.py @@ -41,9 +41,9 @@ class BroadcastMessage(JSONModel): def __lt__(self, other): return ( - self.cancelled_at or self.finishes_at + self.cancelled_at or self.finishes_at or self.created_at ) < ( - other.cancelled_at or other.finishes_at + other.cancelled_at or other.finishes_at or self.created_at ) @classmethod diff --git a/app/templates/views/broadcast/view-message.html b/app/templates/views/broadcast/view-message.html index d07ce3052..12a89141a 100644 --- a/app/templates/views/broadcast/view-message.html +++ b/app/templates/views/broadcast/view-message.html @@ -21,9 +21,6 @@ {% if broadcast_message.created_by == current_user and current_user.has_permissions('send_messages') %}