From d681c9d2461f35c71e026a33ff0e8c8611b8ae78 Mon Sep 17 00:00:00 2001 From: viennet Date: Fri, 1 Jan 2021 17:45:43 +0100 Subject: [PATCH] =?UTF-8?q?Saisie=20absences:=20ajuste=20la=20liste=20des?= =?UTF-8?q?=20=C3=A9tudiants=20quand=20on=20change=20le=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZAbsences.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ZAbsences.py b/ZAbsences.py index 08e429d2..34fe59e1 100644 --- a/ZAbsences.py +++ b/ZAbsences.py @@ -957,6 +957,17 @@ class ZAbsences( self.getEtudInfo(etudid=m["etudid"], filled=True)[0] for m in groups_infos.members ] + # Restreint aux inscrits au module sélectionné + if moduleimpl_id: + mod_inscrits = set( + [ + x["etudid"] + for x in self.Notes.do_moduleimpl_inscription_list( + moduleimpl_id=moduleimpl_id + ) + ] + ) + etuds = [e for e in etuds if e["etudid"] in mod_inscrits] nt = self.Notes._getNotesCache().get_NotesTable(self.Notes, formsemestre_id) sem = sco_formsemestre.do_formsemestre_list( self, {"formsemestre_id": formsemestre_id} @@ -1074,14 +1085,23 @@ class ZAbsences( + "

Aucun étudiant !

" + self.sco_footer(REQUEST) ) - formsemestre_id = groups_infos.formsemestre_id require_module = self.get_preference("abs_require_module", formsemestre_id) etuds = [ self.getEtudInfo(etudid=m["etudid"], filled=True)[0] for m in groups_infos.members ] - + # Restreint aux inscrits au module sélectionné + if moduleimpl_id: + mod_inscrits = set( + [ + x["etudid"] + for x in self.Notes.do_moduleimpl_inscription_list( + moduleimpl_id=moduleimpl_id + ) + ] + ) + etuds = [e for e in etuds if e["etudid"] in mod_inscrits] if not moduleimpl_id: moduleimpl_id = None base_url_noweeks = "SignaleAbsenceGrSemestre?datedebut=%s&datefin=%s&%s&destination=%s" % (