1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00

🐛 Fix notebooks in private projects not being returned for the group owner

This commit is contained in:
Steffo 2021-10-14 03:28:06 +02:00
parent 8b08e08282
commit 6f3e2fc9e9

View file

@ -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)
)