fix: Allow all notifications to be marked as read
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
moanos [he/him] 2024-11-20 23:37:55 +01:00
parent 202dfe46c2
commit 3eb7dbe984

View File

@ -451,7 +451,10 @@ def my_profile(request):
action = request.POST.get("action") action = request.POST.get("action")
if action == "notification_mark_read": if action == "notification_mark_read":
notification_id = request.POST.get("notification_id") notification_id = request.POST.get("notification_id")
try:
notification = CommentNotification.objects.get(pk=notification_id) notification = CommentNotification.objects.get(pk=notification_id)
except CommentNotification.DoesNotExist:
notification = BaseNotification.objects.get(pk=notification_id)
notification.read = True notification.read = True
notification.save() notification.save()
elif action == "notification_mark_all_read": elif action == "notification_mark_all_read":