diff --git a/app/models/etudiants.py b/app/models/etudiants.py index a81ac73d5..30e42d25b 100644 --- a/app/models/etudiants.py +++ b/app/models/etudiants.py @@ -199,6 +199,11 @@ class Identite(models.ScoDocModel): @classmethod def get_etud(cls, etudid: int) -> "Identite": """Etudiant ou 404, cherche uniquement dans le département courant""" + if not isinstance(etudid, int): + try: + etudid = int(etudid) + except (TypeError, ValueError): + abort(404, "etudid invalide") if g.scodoc_dept: return cls.query.filter_by( id=etudid, dept_id=g.scodoc_dept_id