]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixed problem in data cache with international strings
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 19 Feb 2013 15:00:12 +0000 (15:00 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 19 Feb 2013 15:00:12 +0000 (15:00 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1282 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/base.py

index 47f71e0c4c6e857db7bc5e9def1d82d2f06de3b0..a5f74eb39821c17213094a40ff668e90240941fd 100644 (file)
@@ -178,7 +178,10 @@ class CachedQuerySet(models.query.QuerySet):
                 yield row
 
     def _get_query_hash(self):
-        return md5(unicode(self.query).encode("utf-8")).hexdigest()
+        try:
+            return md5(unicode(self.query).encode("utf-8")).hexdigest()
+        except:
+            return md5(self.query).hexdigest()