X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/303b118d8ffc0ed2285166e362a91774f64ad807..9679e5dae018bf9ea892fc17f2b92ff5400aef86:/forum/models/base.py 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