1
0
forked from ScoDoc/ScoDoc

Tableau bord module: n'affiche pas saisie abs pour groupes vides

This commit is contained in:
Emmanuel Viennet 2023-06-09 20:36:31 +02:00 committed by iziram
parent c8c231a368
commit 56352d6ce6

View File

@ -861,11 +861,15 @@ def _make_listes_sem(formsemestre: FormSemestre, with_absences=True):
H.append("<h4>Tous les étudiants</h4>")
else:
H.append("<h4>Groupes de %(partition_name)s</h4>" % partition)
partition_is_empty = True
groups = sco_groups.get_partition_groups(partition)
if groups:
H.append("<table>")
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("</tr>")
H.append("</table>")
else:
H.append('<p class="help indent">Aucun groupe dans cette partition')
if partition_is_empty:
H.append('<p class="help indent">Aucun groupe peuplé dans cette partition')
if sco_groups.sco_permissions_check.can_change_groups(formsemestre.id):
H.append(
f""" (<a href="{url_for("scolar.affect_groups",