From 21ea789b44f16d770b7874c80fb522847ea21867 Mon Sep 17 00:00:00 2001 From: Shrivaths Shyam Date: Thu, 30 Nov 2023 11:15:36 -0800 Subject: [PATCH] additional condition to announcementchecker class --- sleap/gui/web.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sleap/gui/web.py b/sleap/gui/web.py index 104649c65..a6fe79d1f 100644 --- a/sleap/gui/web.py +++ b/sleap/gui/web.py @@ -171,13 +171,13 @@ def _read_bulletin_data(self): data = json.load(jsf) self._latest_data = data[0] except FileNotFoundError: - self._latest_data = {} + self._latest_data = None @property - def new_announcement(self): + def new_announcement_available(self): self._read_bulletin_data() if ( - self._latest_data + self._latest_data and self.previous_announcement_date and self._latest_data["date"] != self.previous_announcement_date ): return True @@ -185,7 +185,7 @@ def new_announcement(self): def get_latest_announcement(self) -> Optional[Tuple[str, str]]: """Return latest announcements on the releases page not seen by user.""" - if self.new_announcement: + if self.new_announcement_available: return ( self._latest_data["title"], self._latest_data["date"],