From bb973abfbd566a0f019822453d06f8b0ef3f6dac Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Fri, 3 Nov 2017 17:40:11 +0100 Subject: Prise en compte des groupes qui n’ont pas de sous-groupe dans la liste des groupes pertinents --- models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models.py b/models.py index cb975ab..3af1c06 100644 --- a/models.py +++ b/models.py @@ -86,7 +86,7 @@ class GroupManager(Manager): return self.get_queryset().filter(*args, timetable=timetable, hidden=False, **criteria) \ .annotate(nbsub=Subquery(sub, output_field=models.IntegerField())) \ - .filter(nbsub=1).order_by("name") + .filter(Q(nbsub=1) | Q(nbsub__isnull=True)).order_by("name") class Group(models.Model): -- cgit v1.2.1