diff options
author | Alban Gruin | 2017-11-24 19:28:35 +0100 |
---|---|---|
committer | Alban Gruin | 2017-11-24 19:28:35 +0100 |
commit | ffffa1cef4e0c2f1e617dc74a57c5045325e57aa (patch) | |
tree | 1746c894757bb6c295201a8c4805825b7fd7e001 /models.py | |
parent | b2c14a2db9b79dca007db5e32aefbf76ebd05fd1 (diff) |
Correction d’un bogue qui empêchait l’affichage des groupes si deux
groupes ont le même nom mais pas le même semestre.
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -83,9 +83,10 @@ class GroupManager(Manager): timetable=group.timetable) def get_relevant_groups(self, timetable, *args, **criteria): - sub = self.get_queryset().filter(timetable=timetable, mention=OuterRef("mention"), - subgroup__startswith=OuterRef("subgroup")) \ - .order_by().values("mention").annotate(c=Count("*")).values("c") + sub = self.get_queryset().filter(timetable=timetable, + mention__startswith=OuterRef("mention"), + subgroup__startswith=OuterRef("subgroup")) \ + .order_by().values("mention").annotate(c=Count("*")).values("c") return self.get_queryset().filter(*args, timetable=timetable, hidden=False, **criteria) \ .annotate(nbsub=Subquery(sub, output_field=models.IntegerField())) \ |