]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/base.py
Gravatar avatars are shown even if the emails left is lowercased, uppercased or rando...
[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):
 
 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
             return LazyQueryList(self.model, list(self.values_list('id', flat=True)))
         else:
             return self