aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2024-01-28 12:19:17 +0100
committerAndrea Lepori <alepori@student.ethz.ch>2024-01-28 12:19:17 +0100
commitcf4090543de0e4032b0c40046a52807124fdc6eb (patch)
tree6e77f90f6fc0c83176fefc8c528759dfb6de38c3 /accounts
parentdo not save usercodes without names (diff)
downloadscout-subs-cf4090543de0e4032b0c40046a52807124fdc6eb.tar.gz
scout-subs-cf4090543de0e4032b0c40046a52807124fdc6eb.zip
fix missing date warning
Diffstat (limited to 'accounts')
-rw-r--r--accounts/views.py7
1 files changed, 4 insertions, 3 deletions
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,