From b0eb0f7ebfc4041676a3ff00bcb250fb4b543e0f Mon Sep 17 00:00:00 2001 From: Christian Glatthard Date: Sun, 30 Aug 2015 17:02:39 +0200 Subject: [PATCH] fix sharing of images in frontend, fix api query for images --- ipynbsrv/api/views.py | 2 +- .../web/templates/web/containers/index.html | 6 +++++ .../web/containers/modal_create.html | 2 +- ipynbsrv/web/templates/web/images/index.html | 11 +++++---- ipynbsrv/web/templates/web/images/manage.html | 23 ++++++++++++------- .../templates/web/images/modal_create.html | 6 ++--- ipynbsrv/web/views/containers.py | 3 ++- ipynbsrv/web/views/images.py | 3 ++- 8 files changed, 37 insertions(+), 19 deletions(-) diff --git a/ipynbsrv/api/views.py b/ipynbsrv/api/views.py index 4119d92..545433c 100644 --- a/ipynbsrv/api/views.py +++ b/ipynbsrv/api/views.py @@ -723,7 +723,7 @@ def get_queryset(self): collab_group = self.request.user.backend_user.get_collaboration_group() if collab_group: queryset = ContainerImage.objects.filter( - Q(is_internal=False) & (Q(owner=self.request.user) | Q(is_public=True) | Q(access_groups=collab_group)) + Q(is_internal=False) & (Q(owner=self.request.user) | Q(is_public=True) | Q(access_groups__user=self.request.user)) ).distinct() else: queryset = ContainerImage.objects.filter( diff --git a/ipynbsrv/web/templates/web/containers/index.html b/ipynbsrv/web/templates/web/containers/index.html index f2584bf..7c4ec95 100644 --- a/ipynbsrv/web/templates/web/containers/index.html +++ b/ipynbsrv/web/templates/web/containers/index.html @@ -23,6 +23,12 @@

Containers