From 37bfbd7dcdd2542228984b1f8161fd94860750f7 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Thu, 29 Dec 2022 11:16:40 +0100 Subject: remove unarchive, enable archive unapproved docs --- server/templates/server/doc_list.html | 3 ++- server/views.py | 30 +++++++++++++----------------- version.txt | 2 +- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html index 023cf54..06c8893 100644 --- a/server/templates/server/doc_list.html +++ b/server/templates/server/doc_list.html @@ -17,7 +17,7 @@
  • archive
  • -
  • unarchive
  • +
  • file_download
  • {% if settings.DEBUG %}
  • checkDEBUG
  • @@ -38,6 +38,7 @@ diff --git a/server/views.py b/server/views.py index fb4af8a..89c66b2 100644 --- a/server/views.py +++ b/server/views.py @@ -1118,23 +1118,19 @@ def doclist(request): docc.status = 'ok' docc.save() elif request.POST["action"] == 'archive': - if docc.status == 'ok': - docc.status = 'archive' - if docc.medical_data: - docc.medical_data.delete() - docc.medical_data.save() - docc.medical_data = None - docc.save() - else: - error = True - error_text = "Non puoi archiviare un documento non approvato" - elif request.POST["action"] == 'unarchive': - if docc.status == 'archive': - docc.status = 'ok' - docc.save() - else: - error = True - error_text = "Non puoi dearchiviare un documento non archiviato" + docc.status = 'archive' + if docc.medical_data: + docc.medical_data.delete() + docc.medical_data.save() + docc.medical_data = None + docc.save() + #elif request.POST["action"] == 'unarchive': + # if docc.status == 'archive': + # docc.status = 'ok' + # docc.save() + # else: + # error = True + # error_text = "Non puoi dearchiviare un documento non archiviato" # get filter values hidden = "filter_hidden" in request.POST diff --git a/version.txt b/version.txt index 13d18eb..9736897 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ version=0.6 -rev=12 +rev=13 -- cgit v1.2.1