aboutsummaryrefslogtreecommitdiffstats
path: root/server/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'server/views.py')
-rw-r--r--server/views.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/views.py b/server/views.py
index 09ab79a..c06046d 100644
--- a/server/views.py
+++ b/server/views.py
@@ -728,9 +728,6 @@ def doctype(request):
if not selfsign:
public_types = public_types.filter(auto_sign=False)
selfsign_check = ""
- if not hidden:
- public_types = public_types.filter(enabled=True)
- hidden_check = ""
if not personal:
public_types = public_types.filter(personal_data=False)
personal_check = ""
@@ -747,16 +744,23 @@ def doctype(request):
public_types = public_types.filter(custom_group=False)
group_check = ""
+ if not hidden:
+ hidden_check = ""
+
users_capi = User.objects.filter(groups__name__contains="capi")
docs = []
for doc in public_types:
- doc_count = str(Document.objects.filter(document_type=doc).count())
+ doc_count_int = Document.objects.filter(document_type=doc).count()
+ doc_count = str(doc_count_int)
ref_docs_archived = Document.objects.filter(document_type=doc, status="archive").count()
if ref_docs_archived > 0:
doc_count += "-" + str(ref_docs_archived)
if doc.max_instances != 0:
doc_count += "/" + str(doc.max_instances)
+ if not hidden and doc.enabled == False and doc_count_int == ref_docs_archived:
+ continue
+
doc_obj = Document.objects.filter(document_type=doc).exclude(status="archive").select_related(
"usercode", "usercode__branca__name", "usercode__user__groups__name"
)