From 264ef7e1ff8fcc6ddbf4caf977c4a255bc6015e2 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 22 Jan 2022 17:37:04 +0100 Subject: [PATCH] formsemestre_bulletinetud avec arg INE: filtre sur dept --- app/views/notes.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/notes.py b/app/views/notes.py index 8b0509666..4be64afbb 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -290,16 +290,17 @@ def formsemestre_bulletinetud( if etudid: etud = models.Identite.query.get_or_404(etudid) elif code_nip: - dept = formsemestre.dept_id etud = ( models.Identite.query.filter_by(code_nip=str(code_nip)) - .filter_by(dept_id=dept) + .filter_by(dept_id=formsemestre.dept_id) .first_or_404() ) elif code_ine: - etud = models.Identite.query.filter_by( - code_ine=str(code_ine) - ).first_or_404() + etud = ( + models.Identite.query.filter_by(code_ine=str(code_ine)) + .filter_by(dept_id=formsemestre.dept_id) + .first_or_404() + ) else: raise ScoValueError( "Paramètre manquant: spécifier code_nip ou etudid ou code_ine"