From f749f6e82d356037e285834ecdf70ba8f83ab58f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 31 Aug 2022 19:20:40 +0200 Subject: [PATCH] BUT/parcours: tri sur page visu inscriptions --- app/scodoc/sco_moduleimpl_inscriptions.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/scodoc/sco_moduleimpl_inscriptions.py b/app/scodoc/sco_moduleimpl_inscriptions.py index b2be0e50e..d9f2a9989 100644 --- a/app/scodoc/sco_moduleimpl_inscriptions.py +++ b/app/scodoc/sco_moduleimpl_inscriptions.py @@ -264,9 +264,7 @@ def moduleimpl_inscriptions_stats(formsemestre_id): args={"formsemestre_id": formsemestre_id} ) set_all = set([x["etudid"] for x in inscrits]) - partitions, partitions_etud_groups = sco_groups.get_formsemestre_groups( - formsemestre_id - ) + partitions, _ = sco_groups.get_formsemestre_groups(formsemestre_id) can_change = ( authuser.has_permission(Permission.ScoEtudInscrit) and formsemestre.etat @@ -277,7 +275,11 @@ def moduleimpl_inscriptions_stats(formsemestre_id): options = [] # modules ou seuls quelques etudiants sont inscrits mod_description = {} # modimplid : str mod_nb_inscrits = {} # modimplid : int - for modimpl in formsemestre.modimpls_sorted: + if is_apc: + modimpls = sorted(formsemestre.modimpls, key=lambda m: m.module.sort_key_apc()) + else: + modimpls = formsemestre.modimpls_sorted + for modimpl in modimpls: tous_inscrits, nb_inscrits, descr = descr_inscrs_module( modimpl.id, set_all,