From 18061b96974de722d23c11fd76934ed1c850b380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Thu, 18 Apr 2024 17:40:52 +0300 Subject: [PATCH 1/1] Handling a malformed reaction notification --- model.py | 2 +- user.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/model.py b/model.py index 2268de5..f2486ef 100644 --- a/model.py +++ b/model.py @@ -157,7 +157,7 @@ class Notification: icon = '🙏 ' elif self.type == Notification.REACTION: event = f'reacted to your {kind}' - icon = self.reaction + ' ' + icon = (self.reaction if self.reaction else '🔔') + ' ' elif self.type == Notification.COMMENT: event = f'commented on your {kind}' icon = '💬 ' diff --git a/user.py b/user.py index 8d711ce..4aaf416 100644 --- a/user.py +++ b/user.py @@ -348,11 +348,7 @@ class Subgrouping: src.append('') # Print the notifications. for notif in notifs: - try: - src.append('=> %s %s' % notif.entry(with_title=not top_head)) - except: - # FIXME: notif.reaction can be None sometimes? A cancelled notification? - pass + src.append('=> %s %s' % notif.entry(with_title=not top_head)) return '\n'.join(src) + '\n' -- 2.34.1