1
0
forked from ScoDoc/ScoDoc

Améliore traitement erreur si id invalide envoyé à formsemestre_validation_but

This commit is contained in:
Emmanuel Viennet 2023-07-06 09:57:51 +02:00
parent c5a702e6d1
commit 428a34e6ba

View File

@ -2339,14 +2339,14 @@ def formsemestre_validation_but(
formsemestre: FormSemestre = FormSemestre.query.filter_by( formsemestre: FormSemestre = FormSemestre.query.filter_by(
id=formsemestre_id, dept_id=g.scodoc_dept_id id=formsemestre_id, dept_id=g.scodoc_dept_id
).first_or_404() ).first_or_404()
etud = Identite.get_etud(etudid)
nb_etuds = formsemestre.etuds.count()
# la route ne donne pas le type d'etudid pour pouvoir construire des URLs # la route ne donne pas le type d'etudid pour pouvoir construire des URLs
# provisoires avec NEXT et PREV # provisoires avec NEXT et PREV
try: try:
etudid = int(etudid) etudid = int(etudid)
except ValueError: except ValueError as exc:
abort(404, "invalid etudid") raise ScoValueError("adresse invalide") from exc
etud = Identite.get_etud(etudid)
nb_etuds = formsemestre.etuds.count()
read_only = not formsemestre.can_edit_jury() read_only = not formsemestre.can_edit_jury()
# --- Navigation # --- Navigation