From f3fb72eee5a6ffe94990d4d97c1e9aed35575433 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Thu, 30 Jul 2020 12:33:01 +0200 Subject: block debug actions and confirm for approve doc --- server/templates/server/upload_doc.html | 12 +++++++++--- server/views.py | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'server') diff --git a/server/templates/server/upload_doc.html b/server/templates/server/upload_doc.html index 334a819..3650cd8 100644 --- a/server/templates/server/upload_doc.html +++ b/server/templates/server/upload_doc.html @@ -25,9 +25,7 @@ - Anteprima documento -
@@ -41,7 +39,8 @@
@@ -61,6 +60,13 @@ {% endblock %} {% block script %} +function confirm() { + var button = document.getElementById('send_button') + button.innerHTML = "Sicuro?" + button.setAttribute('onclick', "document.getElementById('form').submit()") + button.setAttribute('class', "waves-effect waves-light btn green") +} + function send() { var form = document.getElementById('preview_form') var action = document.getElementById('code_submit') diff --git a/server/views.py b/server/views.py index b230d51..c23e8c8 100644 --- a/server/views.py +++ b/server/views.py @@ -455,9 +455,9 @@ def doclist(request): selected.append(docc) for i in selected: - if request.POST["action"] == 'delete': + if request.POST["action"] == 'delete' and settings.DEBUG: i.delete() - elif request.POST["action"] == 'approve': + elif request.POST["action"] == 'approve' and settings.DEBUG: i.status = 'ok' i.save() elif request.POST["action"] == 'archive': -- cgit v1.2.1