aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-09-04 13:31:15 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-09-04 13:31:15 +0200
commitfff70a7839716a44d28db5789b19adb72afc8eb5 (patch)
treec0dbf01bac1c7aa441de35cb0d25212c863d128a /client
parentallow pdf upload (diff)
downloadscout-subs-fff70a7839716a44d28db5789b19adb72afc8eb5.tar.gz
scout-subs-fff70a7839716a44d28db5789b19adb72afc8eb5.zip
update creation date of doc on edit
Diffstat (limited to '')
-rw-r--r--client/views.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/client/views.py b/client/views.py
index 4bc7e0e..8b0ac7b 100644
--- a/client/views.py
+++ b/client/views.py
@@ -12,6 +12,8 @@ from io import BytesIO
import pdfkit
import base64
from subprocess import check_output
+from datetime import datetime
+import pytz
def index(request):
@@ -247,6 +249,10 @@ def edit_wrapper(request, context):
if document.user != request.user:
return
+ # update compilation date
+ document.compilation_date = pytz.timezone('Europe/Zurich').localize(datetime.now())
+ document.save(update_fields=["compilation_date"])
+
# save again all data
usercode = UserCode.objects.filter(user=document.user)[0]