aboutsummaryrefslogtreecommitdiffstats
path: root/server/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-12-29 11:16:40 +0100
committerAndrea Lepori <alepori@student.ethz.ch>2022-12-29 11:16:41 +0100
commit37bfbd7dcdd2542228984b1f8161fd94860750f7 (patch)
tree25cf42a5905b74f60de2744b9c468567e288be49 /server/views.py
parentfix quick select for readonly doclist (diff)
downloadscout-subs-37bfbd7dcdd2542228984b1f8161fd94860750f7.tar.gz
scout-subs-37bfbd7dcdd2542228984b1f8161fd94860750f7.zip
remove unarchive, enable archive unapproved docs
Diffstat (limited to '')
-rw-r--r--server/views.py30
1 files changed, 13 insertions, 17 deletions
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