From 52e837dc817318110657d51bbd63987482843a1e Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 7 Oct 2021 22:24:43 +0200 Subject: [PATCH] =?UTF-8?q?am=C3=A9liore=20msg=20err=20sur=20imports=20etu?= =?UTF-8?q?diants=20excel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_import_etuds.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/scodoc/sco_import_etuds.py b/app/scodoc/sco_import_etuds.py index 1107b11f..0bd9d447 100644 --- a/app/scodoc/sco_import_etuds.py +++ b/app/scodoc/sco_import_etuds.py @@ -548,6 +548,12 @@ def _import_one_student( else: args["formsemestre_id"] = values["codesemestre"] formsemestre_id = values["codesemestre"] + try: + formsemestre_id = int(formsemestre_id) + except ValueError as exc: + raise ScoValueError( + f"valeur invalide dans la colonne codesemestre, ligne {linenum+1}" + ) from exc # recupere liste des groupes: if formsemestre_id not in GroupIdInferers: GroupIdInferers[formsemestre_id] = sco_groups.GroupIdInferer(formsemestre_id)