]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/base.py
Fix in query cache
[osqa.git] / forum / models / base.py
index a5f74eb39821c17213094a40ff668e90240941fd..912c21ac768129ce66b8d955b5ee751e4869f3ea 100644 (file)
@@ -181,8 +181,10 @@ class CachedQuerySet(models.query.QuerySet):
         try:
             return md5(unicode(self.query).encode("utf-8")).hexdigest()
         except:
-            return md5(self.query).hexdigest()        
-
+            try:
+                return md5(self.query).hexdigest()
+            except:
+                return md5(str(self.query)).hexdigest()
 
 
 class CachedManager(models.Manager):