From ec62bc84aa89b5e946104bc4dcdf78f382c90165 Mon Sep 17 00:00:00 2001 From: hernani Date: Wed, 13 Mar 2013 23:08:25 +0000 Subject: [PATCH] Fix in query cache git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1283 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/models/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/forum/models/base.py b/forum/models/base.py index a5f74eb..912c21a 100644 --- a/forum/models/base.py +++ b/forum/models/base.py @@ -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): -- 2.39.5