aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2024-01-29 17:09:28 +0100
committerAndrea Lepori <alepori@student.ethz.ch>2024-01-29 17:09:28 +0100
commit3734ff0bf3547a35769221035f8d6e54bf637b23 (patch)
tree35f47161749dc33820c155c5076180b747450089
parentadd impersonate button (diff)
downloadscout-subs-3734ff0bf3547a35769221035f8d6e54bf637b23.tar.gz
scout-subs-3734ff0bf3547a35769221035f8d6e54bf637b23.zip
fix show docs in ulist
Diffstat (limited to '')
-rw-r--r--client/templatetags/app_filter.py5
-rw-r--r--server/templates/server/user_list.html2
-rw-r--r--server/views.py2
-rw-r--r--version.txt2
4 files changed, 5 insertions, 6 deletions
diff --git a/client/templatetags/app_filter.py b/client/templatetags/app_filter.py
index 335827e..9fbcff0 100644
--- a/client/templatetags/app_filter.py
+++ b/client/templatetags/app_filter.py
@@ -14,9 +14,8 @@ def doc_key_type(doc_type):
return Keys.objects.filter(container=doc_type)
@register.filter(name="user_docs")
-def user_docs(admin_user, user):
- parent_groups = admin_user.groups.values_list('name', flat=True)
- documents = Document.objects.filter(Q(user=user) & ~Q(status='archive') & Q(document_type__group__name__in=parent_groups))
+def user_docs(usercode):
+ documents = Document.objects.filter(Q(usercode=usercode) & ~Q(status='archive'))
return documents
@register.filter(name="user_groups")
diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html
index 0a47428..e5fb0da 100644
--- a/server/templates/server/user_list.html
+++ b/server/templates/server/user_list.html
@@ -303,7 +303,7 @@
</div>
<div class="collapsible-body"><span>
<ul class="collapsible">
- {% for doc in request.user|user_docs:user.user %}
+ {% for doc in user|user_docs %}
<li>
<div class="collapsible-header"><a onclick="send('f{{doc.id}}')">{{doc.document_type.name}}</a></div>
</li>
diff --git a/server/views.py b/server/views.py
index c569d56..ef13e45 100644
--- a/server/views.py
+++ b/server/views.py
@@ -392,7 +392,7 @@ def ulist(request):
elif request.POST["action"][0] == 'f':
document = Document.objects.get(id=request.POST["action"][1:])
# check if user has permission to view document
- if document.group == groups[0]:
+ if document.group in groups:
vac_file = ""
health_file = ""
sign_doc_file = ""
diff --git a/version.txt b/version.txt
index 1d64758..0a439ad 100644
--- a/version.txt
+++ b/version.txt
@@ -1,2 +1,2 @@
version=0.7
-rev=20
+rev=21