From 12a212c4c37e900fc9f242b8f1afa8261c8ee41c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-S=C3=A9bastien=20Caux?= <git@jscaux.org>
Date: Tue, 19 Mar 2024 22:33:46 +0100
Subject: [PATCH] Debug Note manager

---
 scipost_django/pins/managers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scipost_django/pins/managers.py b/scipost_django/pins/managers.py
index 483504b96..4387f4e2d 100644
--- a/scipost_django/pins/managers.py
+++ b/scipost_django/pins/managers.py
@@ -18,7 +18,7 @@ class NotesQuerySet(models.QuerySet):
         Filter out notes which are not visible to the given user.
         """
 
-        if user is None:
+        if user is None or not user.is_authenticated:
             # Without specifying a user, only public notes are visible
             return self.filter(visibility=self.model.VISIBILITY_PUBLIC)
         else:
-- 
GitLab