From fff70a7839716a44d28db5789b19adb72afc8eb5 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Fri, 4 Sep 2020 13:31:15 +0200 Subject: update creation date of doc on edit --- client/views.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'client') 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] -- cgit v1.2.1