From cba354098f15c2539384fd348bd41b99072e3c63 Mon Sep 17 00:00:00 2001 From: Ben Rog-Wilhelm Date: Fri, 25 Aug 2023 02:23:25 -0500 Subject: [PATCH] Compensate for a currently-unsolved bug involving notifications with weird states. --- files/classes/comment.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 3e6e88082..7b9ab2d20 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -382,8 +382,11 @@ class Comment(CreatedBase): return "Notification" elif self.sentto == MODMAIL_ID: return "Sent to admins" - else: + elif self.senttouser is not None: return f"Sent to @{self.senttouser.username}" + else: + # This shouldn't actually be possible. + return "" @lazy def voted_display(self, v) -> int: