From 2915f4e9815a36bcedf1f3e21855cd916f2c4d9b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 2 Feb 2024 16:34:27 +0100 Subject: [PATCH] Fix: check arg formsemestre_set_elt_sem_apo --- app/views/notes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/notes.py b/app/views/notes.py index 0572353bc..1201747ed 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -3106,7 +3106,10 @@ def formsemestre_set_elt_sem_apo(): """Change les codes étapes du semestre indiqué. Args: oid=formsemestre_id, value=chaine "V3ONM, V3ONM1, V3ONM2", codes séparés par des virgules """ - oid = int(request.form.get("oid")) + try: + oid = int(request.form.get("oid")) + except (TypeError, ValueError) as exc: + raise ScoValueError("paramètre invalide") from exc value = (request.form.get("value") or "").strip() formsemestre: FormSemestre = FormSemestre.query.get_or_404(oid) if value != formsemestre.elt_sem_apo: