]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/base.py
Previous feature addition commit introduced errors; rolling back to previous revision...
[osqa.git] / forum / models / base.py
index 3d54d75e95d8025efee2a6af8c97ebf3b47e60a8..2f934a916f349be0eca77c9c56d0347d7b3944fa 100644 (file)
@@ -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