mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-24 01:49:15 -04:00
Allow broadcasts which have no created_at to be compared
This adds to the `__le__` method on the `BroadcastMessage` class to allow two BroadcastMessages with no `updated_at` to be compared. Previously, the method expected at least one message to have `updated_at` set, but this is not necessarily the case.
This commit is contained in:
@@ -49,6 +49,8 @@ class BroadcastMessage(JSONModel):
|
||||
return self.updated_at < other.created_at
|
||||
if not self.updated_at and other.updated_at:
|
||||
return self.created_at < other.updated_at
|
||||
if not self.updated_at and not other.updated_at:
|
||||
return self.created_at < other.created_at
|
||||
return self.updated_at < other.updated_at
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user