From 3eb7dbe9843dfa6fecf653477d59464e8e557936 Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 20 Nov 2024 23:37:55 +0100 Subject: [PATCH] fix: Allow all notifications to be marked as read --- src/fellchensammlung/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 2c91524..fa34fcb 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -451,7 +451,10 @@ def my_profile(request): action = request.POST.get("action") if action == "notification_mark_read": notification_id = request.POST.get("notification_id") - notification = CommentNotification.objects.get(pk=notification_id) + try: + notification = CommentNotification.objects.get(pk=notification_id) + except CommentNotification.DoesNotExist: + notification = BaseNotification.objects.get(pk=notification_id) notification.read = True notification.save() elif action == "notification_mark_all_read":