aboutsummaryrefslogtreecommitdiffstats
path: root/server/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-05-26 19:10:29 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2022-05-26 19:10:29 +0200
commitcddcb628ec7d0a9ea5d7cde8bdf88d0c658c02d4 (patch)
tree42468f17601442971fc086b9aa530122677aa486 /server/views.py
parentfix dropdown on safari (ios) (diff)
downloadscout-subs-cddcb628ec7d0a9ea5d7cde8bdf88d0c658c02d4.tar.gz
scout-subs-cddcb628ec7d0a9ea5d7cde8bdf88d0c658c02d4.zip
fix do not show pubblic types in admin page
Diffstat (limited to 'server/views.py')
-rw-r--r--server/views.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/server/views.py b/server/views.py
index f8b0865..d471e65 100644
--- a/server/views.py
+++ b/server/views.py
@@ -51,18 +51,12 @@ def index(request):
# if user is staff of not primary show only public types
if request.user.is_staff:
groups = request.user.groups.all()
-
- q_obj = Q(group__in=groups)
-
- doc_types = DocumentType.objects.filter(
- (Q(group_private=False) | q_obj) & Q(enabled=True)).order_by("-id")
else:
groups = request.user.groups.all()[1:]
- q_obj = Q(group__in=groups)
+ q_obj = Q(group__in=groups)
- doc_types = DocumentType.objects.filter(
- Q(group_private=False) & Q(enabled=True) & q_obj).order_by("-id")
+ doc_types = DocumentType.objects.filter(q_obj & Q(enabled=True)).order_by("-id")
# check for settings
group_check = []