aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-05-31 16:14:41 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2022-05-31 16:14:42 +0200
commit587436fce706f5b74d6880b29d35732dcb5e6de3 (patch)
tree68283e911b3e1f84da9258fb99c70c9b8a988e72 /client
parentget icons directly from google (diff)
downloadscout-subs-587436fce706f5b74d6880b29d35732dcb5e6de3.tar.gz
scout-subs-587436fce706f5b74d6880b29d35732dcb5e6de3.zip
get complete list of documents for the user
Diffstat (limited to '')
-rw-r--r--client/templatetags/app_filter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/templatetags/app_filter.py b/client/templatetags/app_filter.py
index 5385852..1da2aba 100644
--- a/client/templatetags/app_filter.py
+++ b/client/templatetags/app_filter.py
@@ -15,8 +15,8 @@ def doc_key_type(doc_type):
@register.filter(name="user_docs")
def user_docs(admin_user, user):
- parent_group = admin_user.groups.values_list('name', flat=True)[0]
- documents = Document.objects.filter(Q(user=user) & ~Q(status='archive') & Q(group__name=parent_group))
+ 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))
return documents
@register.filter(name="user_groups")