From 7c89b9a8d327a290e50bb8b674f4ffc1f70472ca Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 21 Jan 2022 22:03:16 +0100 Subject: [PATCH] Message d'erreur si upload notes xls avec etudid invalide --- app/scodoc/sco_saisie_notes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/scodoc/sco_saisie_notes.py b/app/scodoc/sco_saisie_notes.py index d0a5407dd..9ccbd9c8d 100644 --- a/app/scodoc/sco_saisie_notes.py +++ b/app/scodoc/sco_saisie_notes.py @@ -153,7 +153,10 @@ def _check_notes(notes, evaluation, mod): for (etudid, note) in notes: note = str(note).strip().upper() - etudid = int(etudid) # + try: + etudid = int(etudid) # + except ValueError as exc: + raise ScoValueError(f"Code étudiant ({etudid}) invalide") if note[:3] == "DEM": continue # skip ! if note: