diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py
index 8fbe06c40..817d818ff 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""" (