From c73581c52feeeb5b7f7c06ab4c9f480f98d2418f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 9 Jun 2023 20:36:31 +0200 Subject: [PATCH] Tableau bord module: n'affiche pas saisie abs pour groupes vides --- app/scodoc/sco_formsemestre_status.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 8fbe06c40f..817d818ff8 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -875,11 +875,15 @@ def _make_listes_sem(formsemestre: FormSemestre, with_absences=True): H.append("

Tous les étudiants

") else: H.append("

Groupes de %(partition_name)s

" % partition) + partition_is_empty = True groups = sco_groups.get_partition_groups(partition) if groups: H.append("") for group in groups: n_members = len(sco_groups.get_group_members(group["group_id"])) + if n_members == 0: + continue # skip empty groups + partition_is_empty = False group["url_etat"] = url_for( "absences.EtatAbsencesGr", group_ids=group["group_id"], @@ -912,8 +916,8 @@ def _make_listes_sem(formsemestre: FormSemestre, with_absences=True): H.append("") H.append("
") - else: - H.append('

Aucun groupe dans cette partition') + if partition_is_empty: + H.append('

Aucun groupe peuplé dans cette partition') if sco_groups.sco_permissions_check.can_change_groups(formsemestre.id): H.append( f""" (