From be4df7daa54f1a94992eea0cc355c422c9fb013d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 14 Oct 2021 03:28:06 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20notebooks=20in=20private?= =?UTF-8?q?=20projects=20not=20being=20returned=20for=20the=20group=20owne?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/sophon/notebooks/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/sophon/notebooks/views.py b/backend/sophon/notebooks/views.py index 3a14998..4c2211d 100644 --- a/backend/sophon/notebooks/views.py +++ b/backend/sophon/notebooks/views.py @@ -67,7 +67,8 @@ class NotebooksByProjectViewSet(NotebooksViewSet): Q(project__slug=self.kwargs["project_slug"]) & ( Q(project__visibility="PUBLIC") | Q(project__visibility="INTERNAL") | - Q(project__visibility="PRIVATE", project__group__members__in=[self.request.user]) + Q(project__visibility="PRIVATE", project__group__members__in=[self.request.user]) | + Q(project__visibility="PRIVATE", project__group__owner=self.request.user) ) ) @@ -94,5 +95,6 @@ class NotebooksBySlugViewSet(NotebooksViewSet): return Notebook.objects.filter( Q(project__visibility="PUBLIC") | Q(project__visibility="INTERNAL") | - Q(project__visibility="PRIVATE", project__group__members__in=[self.request.user]) + Q(project__visibility="PRIVATE", project__group__members__in=[self.request.user]) | + Q(project__visibility="PRIVATE", project__group__owner=self.request.user) )