From d347b95153883f30de50f130ce7035ef7f28ee77 Mon Sep 17 00:00:00 2001 From: Julien Constant <49886317+Juknum@users.noreply.github.com> Date: Sat, 8 Apr 2023 14:48:44 +0200 Subject: [PATCH] Update core/views/site.py Co-Authored-By: thomas girod <56346771+imperosol@users.noreply.github.com> --- core/views/site.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/views/site.py b/core/views/site.py index eadc8a99..c34cf2c4 100644 --- a/core/views/site.py +++ b/core/views/site.py @@ -31,6 +31,7 @@ from django.utils import html from django.views.generic import ListView, TemplateView from django.conf import settings from django.utils.text import slugify +from django.db.models.query import QuerySet import json @@ -51,10 +52,9 @@ class NotificationList(ListView): model = Notification template_name = "core/notification_list.jinja" - def get_queryset(self): + def get_queryset(self) -> QuerySet[Notification]: if self.request.user.is_anonymous: - return [] - + return Notification.objects.none() # TODO: Bulk update in django 2.2 if "see_all" in self.request.GET.keys(): for n in self.request.user.notifications.filter(viewed=False):