From 0b04c2f6796e4f0bd29b4f2e21d44f0453b4453a Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sat, 29 Aug 2020 18:24:24 +0200 Subject: school year format, fix overlapping text in docs --- accounts/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'accounts') diff --git a/accounts/views.py b/accounts/views.py index 696391d..230e3e1 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -114,7 +114,12 @@ def personal(request): usercode.home_phone = request.POST["home_phone"] usercode.phone = request.POST["phone"] usercode.school = request.POST["school"] - usercode.year = request.POST["year"] + if request.POST["year"].isdigit(): + usercode.year = request.POST["year"] + else: + error = True + error_text = "L'anno scolastico deve essere un numero" + usercode.save() medic.emer_name = request.POST["emer_name"] -- cgit v1.2.1