diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2021-08-14 11:38:40 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2021-08-14 11:39:38 +0200 |
commit | 5f309f54798b1a7a0fe6ef8060a8c9a77b3b6d04 (patch) | |
tree | 46353dd8abfe52c535885775b09a0c3c2e16b798 /client/views.py | |
parent | update licence and roll back revision (diff) | |
download | scout-subs-5f309f54798b1a7a0fe6ef8060a8c9a77b3b6d04.tar.gz scout-subs-5f309f54798b1a7a0fe6ef8060a8c9a77b3b6d04.zip |
fix RO documents visible for non group capi
Diffstat (limited to '')
-rw-r--r-- | client/views.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/client/views.py b/client/views.py index 73a252a..d18c074 100644 --- a/client/views.py +++ b/client/views.py @@ -41,15 +41,14 @@ def index(request): context = {"user_code": user_code} else: # get user group - group = request.user.groups.values_list('name', flat=True)[0] + groups = request.user.groups.values_list('name', flat=True) + group = groups[0] # get group settings settings = GroupSettings.objects.filter(group__name=group) - # check if settings exists - if len(settings) == 0: - group_view = False - else: + # check if settings exists and user is in group capi + if len(settings) != 0 and "capi" in groups: # set settings value group_view = settings[0].view_documents |