aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-05-30 19:43:47 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2022-05-30 19:43:48 +0200
commitb7717e71de8796e4cbd43ae011abd7c2ed6b2870 (patch)
tree93d3035d8503fddb001be1003dc3a21666c0f84a
parentdisable debug for materialize fix (diff)
downloadscout-subs-b7717e71de8796e4cbd43ae011abd7c2ed6b2870.tar.gz
scout-subs-b7717e71de8796e4cbd43ae011abd7c2ed6b2870.zip
doclist group filter work as expected
Diffstat (limited to '')
-rw-r--r--client/views.py2
-rw-r--r--server/views.py8
-rw-r--r--version.txt2
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