From d51a47b71af3a3ae7567270a03c557bd7d03610a Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 13 May 2024 17:31:54 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20formulaire=20creation=20=C3=A9tudiant=20?= =?UTF-8?q?(date=20naissance=20vide)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/scolar.py | 10 ++++++++-- sco_version.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/scolar.py b/app/views/scolar.py index ab113a005..c45af3fe5 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -1367,7 +1367,9 @@ def etudident_edit_form(): def _validate_date_naissance(val: str, field) -> bool: - "vrai si date saisie valide" + "vrai si date saisie valide (peut ĂȘtre vide)" + if not val: + return True try: date_naissance = scu.convert_fr_date(val) except ScoValueError: @@ -1788,7 +1790,11 @@ def _etudident_create_or_edit_form(edit): + homonyms_html + F ) - tf[2]["date_naissance"] = scu.convert_fr_date(tf[2]["date_naissance"]) + tf[2]["date_naissance"] = ( + scu.convert_fr_date(tf[2]["date_naissance"]) + if tf[2]["date_naissance"] + else None + ) if not edit: etud = sco_etud.create_etud(cnx, args=tf[2]) etudid = etud["etudid"] diff --git a/sco_version.py b/sco_version.py index 16ddaebd3..67362a1aa 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.6.965" +SCOVERSION = "9.6.966" SCONAME = "ScoDoc"