enhance check xls upload notes

This commit is contained in:
Emmanuel Viennet 2021-11-10 09:37:45 +01:00
parent 03cfcf3298
commit ddf3d73c92

View File

@ -202,11 +202,14 @@ def do_evaluation_upload_xls():
diag.append("Erreur: format invalide ! (pas de ligne evaluation_id)")
raise InvalidNoteValue()
eval_id = int(lines[i][0].strip()[1:])
eval_id_str = lines[i][0].strip()[1:]
try:
eval_id = int(eval_id_str)
except ValueError:
eval_id = None
if eval_id != evaluation_id:
diag.append(
"Erreur: fichier invalide: le code d'évaluation de correspond pas ! ('%s' != '%s')"
% (eval_id, evaluation_id)
f"Erreur: fichier invalide: le code d'évaluation de correspond pas ! ('{eval_id_str}' != '{evaluation_id}')"
)
raise InvalidNoteValue()
# --- get notes -> list (etudid, value)