From f10dd46abbb1c00d2d3cdd0a610486027d4f2a22 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 28 Sep 2024 06:13:35 +0200 Subject: [PATCH] =?UTF-8?q?Assiduite:=20robustifie=20r=C3=A9cup=C3=A9ratio?= =?UTF-8?q?n=20=C3=A9tudiant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/assiduites.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/app/views/assiduites.py b/app/views/assiduites.py index 646ca73c2..e29af120a 100644 --- a/app/views/assiduites.py +++ b/app/views/assiduites.py @@ -228,9 +228,7 @@ def ajout_assiduite_etud() -> str | Response: Returns: str: l'html généré """ - etudid: int = request.args.get("etudid", -1) - etud = Identite.get_etud(etudid) - + etud = Identite.get_etud(request.args.get("etudid")) formsemestre_id = request.args.get("formsemestre_id", None) # Gestion du semestre @@ -605,10 +603,7 @@ def bilan_etud(): ) # Récupération de l'étudiant - etudid = request.args.get("etudid", -1) - etud: Identite = Identite.query.get_or_404(etudid) - if etud.dept_id != g.scodoc_dept_id: - abort(404, "étudiant inexistant dans ce département") + etud = Identite.get_etud(request.args.get("etudid")) # Gestion du filtre de module moduleimpl_id = request.args.get("moduleimpl_id", None) @@ -964,12 +959,7 @@ def calendrier_assi_etud(): Returns: str: l'html généré """ - - # Récupération de l'étudiant - etudid = request.args.get("etudid", -1) - etud: Identite = Identite.query.get_or_404(etudid) - if etud.dept_id != g.scodoc_dept_id: - abort(404, "étudiant inexistant dans ce département") + etud = Identite.get_etud(request.args.get("etudid")) # Options mode_demi: bool = scu.to_bool(request.args.get("mode_demi", "t"))