diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py
index f918ebe78..05167c664 100755
--- a/app/scodoc/sco_formsemestre_status.py
+++ b/app/scodoc/sco_formsemestre_status.py
@@ -861,11 +861,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"],
@@ -898,8 +902,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""" (