aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <aleporia@gmail.com>2023-07-27 12:51:22 +0200
committerAndrea Lepori <aleporia@gmail.com>2023-07-27 12:51:22 +0200
commit6062edc3e830421bfe84f01945ca5340f28fdd9e (patch)
tree763bf456f261dec2ded8ba42707b8964bc5cf5b9 /accounts/views.py
parentuser list and branca tansfer with new uc (diff)
downloadscout-subs-6062edc3e830421bfe84f01945ca5340f28fdd9e.tar.gz
scout-subs-6062edc3e830421bfe84f01945ca5340f28fdd9e.zip
check complete data before doc creation
Diffstat (limited to 'accounts/views.py')
-rw-r--r--accounts/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/accounts/views.py b/accounts/views.py
index 59afbf8..47b66a2 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -549,17 +549,19 @@ def edit(request, code):
missing_fields = False
- if request.POST["birth_date"] == "" or request.POST["birth_date"] == "01 Gennaio 1970" or request.POST["birth_date"] == "None":
+ 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":
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"] == "01 Gennaio 1970" or request.POST["tetanus_date"] == "None":
+ 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":
validation_dic["tetanus_date"] = 'class="datepicker validate invalid" required="" aria-required="true"'
missing_fields = True
+ print("missing!!")
else:
validation_dic["tetanus_date"] = 'class="datepicker validate" required="" aria-required="true"'
+ print("not missing")
for i in required_fields:
if request.POST[i] == "":
@@ -571,6 +573,8 @@ def edit(request, code):
if missing_fields:
errors.append("Alcuni campi richiesti non sono stati compilati")
+ print(validation_dic)
+
# check if user uploaded a file
if "vac_certificate" in request.FILES:
files = request.FILES.getlist('vac_certificate')