From a2ec2f27ec1831bb0df68aba082d75a260a1a205 Mon Sep 17 00:00:00 2001 From: hernani Date: Tue, 19 Feb 2013 15:00:12 +0000 Subject: [PATCH] Fixed problem in data cache with international strings git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1282 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/models/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/forum/models/base.py b/forum/models/base.py index 47f71e0..a5f74eb 100644 --- a/forum/models/base.py +++ b/forum/models/base.py @@ -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() -- 2.39.5