diff --git a/app/scodoc/sco_moduleimpl_inscriptions.py b/app/scodoc/sco_moduleimpl_inscriptions.py index b2be0e50e6..d9f2a99899 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,