From 4df39361fbc9b7fae6d12adbe8fdafe12051bf98 Mon Sep 17 00:00:00 2001 From: Jean-Marie PLACE Date: Sat, 22 Jan 2022 00:14:39 +0100 Subject: [PATCH] now support several departement for a nip when load formsemestre_bulletinetud --- app/views/notes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/notes.py b/app/views/notes.py index 35c9ca83..8b050966 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -290,9 +290,12 @@ def formsemestre_bulletinetud( if etudid: etud = models.Identite.query.get_or_404(etudid) elif code_nip: - etud = models.Identite.query.filter_by( - code_nip=str(code_nip) - ).first_or_404() + dept = formsemestre.dept_id + etud = ( + models.Identite.query.filter_by(code_nip=str(code_nip)) + .filter_by(dept_id=dept) + .first_or_404() + ) elif code_ine: etud = models.Identite.query.filter_by( code_ine=str(code_ine)