forked from ScoDoc/ScoDoc
check invalid etudid
This commit is contained in:
parent
21c0625147
commit
3575e89dc0
@ -199,6 +199,11 @@ class Identite(models.ScoDocModel):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_etud(cls, etudid: int) -> "Identite":
|
def get_etud(cls, etudid: int) -> "Identite":
|
||||||
"""Etudiant ou 404, cherche uniquement dans le département courant"""
|
"""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:
|
if g.scodoc_dept:
|
||||||
return cls.query.filter_by(
|
return cls.query.filter_by(
|
||||||
id=etudid, dept_id=g.scodoc_dept_id
|
id=etudid, dept_id=g.scodoc_dept_id
|
||||||
|
Loading…
Reference in New Issue
Block a user