From 64d8f30006361fe3f142a22318da3a53df3606f3 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 23 Jun 2024 18:15:00 +0100 Subject: [PATCH] Fix crash when mentioning users in comments Thanks @Dragonop for help finding the cause --- app/blueprints/threads/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/blueprints/threads/__init__.py b/app/blueprints/threads/__init__.py index 8fdcdbb5..3c7039c4 100644 --- a/app/blueprints/threads/__init__.py +++ b/app/blueprints/threads/__init__.py @@ -258,7 +258,8 @@ def view(id): add_notification(mentioned, current_user, NotificationType.THREAD_REPLY, msg, thread.get_view_url(), thread.package) - thread.watchers.append(mentioned) + if mentioned not in thread.watchers: + thread.watchers.append(mentioned) msg = "New comment on '{}'".format(thread.title) add_notification(thread.watchers, current_user, NotificationType.THREAD_REPLY, msg, thread.get_view_url(), thread.package)