feat: Add a timestamp for when a notification is read

This commit is contained in:
2025-01-14 07:30:36 +01:00
parent 84ce5f54b2
commit 424f91e919
5 changed files with 64 additions and 6 deletions

View File

@@ -481,13 +481,11 @@ def my_profile(request):
notification = CommentNotification.objects.get(pk=notification_id)
except CommentNotification.DoesNotExist:
notification = BaseNotification.objects.get(pk=notification_id)
notification.read = True
notification.save()
notification.mark_read()
elif action == "notification_mark_all_read":
notifications = CommentNotification.objects.filter(user=request.user, mark_read=False)
for notification in notifications:
notification.read = True
notification.save()
notification.mark_read()
elif action == "search_subscription_delete":
search_subscription_id = request.POST.get("search_subscription_id")
SearchSubscription.objects.get(pk=search_subscription_id).delete()