From b7717e71de8796e4cbd43ae011abd7c2ed6b2870 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Mon, 30 May 2022 19:43:47 +0200 Subject: doclist group filter work as expected --- client/views.py | 2 +- server/views.py | 8 ++++---- version.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/views.py b/client/views.py index a6087aa..f69b614 100644 --- a/client/views.py +++ b/client/views.py @@ -177,7 +177,7 @@ def create(request): # user is cheating abort return HttpResponseRedirect("/") - if not document_type.custom_group and document_type.group.name not in request.user.groups.values_list('name', flat=True): + if document_type.group_private and document_type.group.name not in request.user.groups.values_list('name', flat=True): # user is cheating abort return HttpResponseRedirect("/") diff --git a/server/views.py b/server/views.py index d471e65..988b6b2 100644 --- a/server/views.py +++ b/server/views.py @@ -998,7 +998,7 @@ def doclist(request): if len(groups) > 0: if groups[0] != "": - q_obj &= Q(group__name__in=groups) + q_obj &= Q(user__groups__name__in=groups) chips_groups += groups # run query @@ -1023,7 +1023,7 @@ def doclist(request): "sign_doc_file": sign_doc_file, "types": auto_types, "users": users, - "groups": parent_groups, + "groups": Group.objects.all(), "docs": documents, "hidden_check": hidden_check, "wait_check": wait_check, @@ -1225,7 +1225,7 @@ def doclist_readonly(request): if len(groups) > 0: if groups[0] != "": - q_obj &= Q(group__name__in=groups) + q_obj &= Q(user__groups__name__in=groups) chips_groups += groups # run query @@ -1247,7 +1247,7 @@ def doclist_readonly(request): "sign_doc_file": sign_doc_file, "types": auto_types, "users": users, - "groups": groups_view, + "groups": Group.objects.all(), "docs": documents, "hidden_check": hidden_check, "wait_check": wait_check, diff --git a/version.txt b/version.txt index 7ab6a01..0ec8ad6 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ version=0.5 -rev=25 +rev=26 -- cgit v1.2.1