1
0
forked from ScoDoc/ScoDoc

améliore msg err sur imports etudiants excel

This commit is contained in:
Emmanuel Viennet 2021-10-07 22:24:43 +02:00
parent 190304043d
commit 52e837dc81

View File

@ -548,6 +548,12 @@ def _import_one_student(
else: else:
args["formsemestre_id"] = values["codesemestre"] args["formsemestre_id"] = values["codesemestre"]
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: # recupere liste des groupes:
if formsemestre_id not in GroupIdInferers: if formsemestre_id not in GroupIdInferers:
GroupIdInferers[formsemestre_id] = sco_groups.GroupIdInferer(formsemestre_id) GroupIdInferers[formsemestre_id] = sco_groups.GroupIdInferer(formsemestre_id)