Fix: check arg formsemestre_set_elt_sem_apo

This commit is contained in:
Emmanuel Viennet 2024-02-02 16:34:27 +01:00
parent af659d5f09
commit 2915f4e981

View File

@ -3106,7 +3106,10 @@ def formsemestre_set_elt_sem_apo():
"""Change les codes étapes du semestre indiqué. """Change les codes étapes du semestre indiqué.
Args: oid=formsemestre_id, value=chaine "V3ONM, V3ONM1, V3ONM2", codes séparés par des virgules Args: oid=formsemestre_id, value=chaine "V3ONM, V3ONM1, V3ONM2", codes séparés par des virgules
""" """
try:
oid = int(request.form.get("oid")) 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() value = (request.form.get("value") or "").strip()
formsemestre: FormSemestre = FormSemestre.query.get_or_404(oid) formsemestre: FormSemestre = FormSemestre.query.get_or_404(oid)
if value != formsemestre.elt_sem_apo: if value != formsemestre.elt_sem_apo: