From cf4090543de0e4032b0c40046a52807124fdc6eb Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sun, 28 Jan 2024 12:19:17 +0100 Subject: fix missing date warning --- accounts/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'accounts') diff --git a/accounts/views.py b/accounts/views.py index bd1bbe1..c174fe8 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -571,18 +571,17 @@ def edit(request, code): missing_fields = False - if request.POST["birth_date"] == "" or request.POST["birth_date"].lower() == "01 gennaio 1970" or request.POST["birth_date"] == "None" or request.POST["birth_date"] == "Giovedì 01 Gennaio 1970 00:00": + if request.POST["birth_date"] == "" or request.POST["birth_date"].lower() == "01 gennaio 1970" or request.POST["birth_date"] == "None" or request.POST["birth_date"] == "Giovedì 01 Gennaio 1970 00:00" or request.POST["birth_date"] == "Giovedì 01 Gennaio 1970 01:00": validation_dic["birth_date"] = 'class="datepicker validate invalid" required="" aria-required="true"' missing_fields = True else: validation_dic["birth_date"] = 'class="datepicker validate" required="" aria-required="true"' - if request.POST["tetanus_date"] == "" or request.POST["tetanus_date"].lower() == "01 gennaio 1970" or request.POST["tetanus_date"] == "None" or request.POST["tetanus_date"] == "Giovedì 01 Gennaio 1970 00:00": + if request.POST["tetanus_date"] == "" or request.POST["tetanus_date"].lower() == "01 gennaio 1970" or request.POST["tetanus_date"] == "None" or request.POST["tetanus_date"] == "Giovedì 01 Gennaio 1970 00:00" or request.POST["tetanus_date"] == "Giovedì 01 Gennaio 1970 01:00": validation_dic["tetanus_date"] = 'class="datepicker validate invalid" required="" aria-required="true"' missing_fields = True else: validation_dic["tetanus_date"] = 'class="datepicker validate" required="" aria-required="true"' - print("not missing") for i in required_fields: if request.POST[i] == "": @@ -742,6 +741,8 @@ def edit(request, code): # show tooltip only if user is not approved and there are no errors home_tooltip = (len(errors) == 0) + print("date", usercode.born_date) + # fill context context = { 'ucode': code, -- cgit v1.2.1