diff --git a/ipynbsrv/api/serializer.py b/ipynbsrv/api/serializer.py index 64df83d..28a6cb8 100644 --- a/ipynbsrv/api/serializer.py +++ b/ipynbsrv/api/serializer.py @@ -231,7 +231,7 @@ class NestedShareSerializer(serializers.ModelSerializer): """ tags = TagSerializer(many=True, read_only=True) members = NestedBackendUserSerializer(source='get_members', many=True, read_only=True) - access_groups = NestedCollaborationGroupSerializer(many=True, read_only=True) + access_groups = FlatCollaborationGroupSerializer(many=True, read_only=True) owner = NestedBackendUserSerializer(many=False, read_only=True) class Meta: diff --git a/ipynbsrv/web/templates/web/shares/manage.html b/ipynbsrv/web/templates/web/shares/manage.html index ad4a1d2..d80a65e 100644 --- a/ipynbsrv/web/templates/web/shares/manage.html +++ b/ipynbsrv/web/templates/web/shares/manage.html @@ -102,28 +102,6 @@

Shared with...

{% endfor %} - - {% for user in users %} - {% if user.backend_user.collab_group in share.access_groups %} - - {{ user.backend_user.collab_group.name }} - - {% if request.user.backend_user.id == share.owner.id %} - {% if member.backend_user.id != share.owner %} -
- {% csrf_token %} - - - -
- {% endif %} - {% endif %} - - - {% endif %} - {% endfor %} diff --git a/ipynbsrv/web/templates/web/shares/modal_addgroups.html b/ipynbsrv/web/templates/web/shares/modal_addgroups.html index 3732cf5..43e4cd3 100644 --- a/ipynbsrv/web/templates/web/shares/modal_addgroups.html +++ b/ipynbsrv/web/templates/web/shares/modal_addgroups.html @@ -17,7 +17,7 @@
{% for user in users %} {% if user.backend_user.collab_group %} - {% if user.backend_user.collab_group not in share.access_groups and user != request.user %} + {% if user.backend_user.collab_group.id not in share.access_group_ids and user != request.user %} {% endif %} {% endif %} diff --git a/ipynbsrv/web/views/shares.py b/ipynbsrv/web/views/shares.py index 5a32505..f791694 100644 --- a/ipynbsrv/web/views/shares.py +++ b/ipynbsrv/web/views/shares.py @@ -212,6 +212,7 @@ def manage(request, share_id): client = get_httpclient_instance(request) share = client.shares(share_id).get() + share['access_group_ids'] = [g.id for g in share.access_groups] users = client.users.get() groups = client.collaborationgroups.get() new_notifications_count = len(client.notificationlogs.unread.get())