From 587436fce706f5b74d6880b29d35732dcb5e6de3 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Tue, 31 May 2022 16:14:41 +0200 Subject: get complete list of documents for the user --- client/templatetags/app_filter.py | 4 ++-- version.txt | 2 +- 2 files changed, 3 insertions(+), 3 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") diff --git a/version.txt b/version.txt index 4b81c6f..03a6f3c 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ version=0.5 -rev=30 +rev=31 -- cgit v1.2.1