1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 14:54:22 +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 015de8a40f
commit be4df7daa5
Signed by: steffo
GPG key ID: 6965406171929D01

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