X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/303b118d8ffc0ed2285166e362a91774f64ad807..8c29337f201187a1d8aa0110c9faf36b5d4f9219:/forum/models/base.py?ds=sidebyside diff --git a/forum/models/base.py b/forum/models/base.py index 3d54d75..2f934a9 100644 --- a/forum/models/base.py +++ b/forum/models/base.py @@ -35,7 +35,7 @@ class LazyQueryList(object): class CachedQuerySet(models.query.QuerySet): def lazy(self): - if len(self.query.extra) == 0: + if (not len(self.query.extra)) and (not len(self.query.aggregates)): return LazyQueryList(self.model, list(self.values_list('id', flat=True))) else: return self