]> git.openstreetmap.org Git - osqa.git/commitdiff
Some unicode fixes.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 13 Apr 2011 00:33:47 +0000 (00:33 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 13 Apr 2011 00:33:47 +0000 (00:33 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@976 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/base.py
forum/models/node.py
forum/models/tag.py

index 260910635c2291afaa5a16a83d14048670034d34..1111b43e8b9beac21c3c19fe61a5aa60671462e7 100644 (file)
@@ -162,7 +162,7 @@ class CachedQuerySet(models.query.QuerySet):
                     yield row
 
     def _get_query_hash(self):
-        return md5(str(self.query)).hexdigest()
+        return md5(unicode(self.query).encode("utf-8")).hexdigest()
 
 
 
index afb04cf50ce91fccfbb2e0e157fb01849d890d82..bf82708cdf604644ec0c7a2b5e76a71708d0d9bb 100644 (file)
@@ -382,10 +382,10 @@ class Node(BaseModel, NodeContent):
             return None
         else:
             if self._original_state['tagnames']:
-                old_tags = set(name for name in self._original_state['tagnames'].split(u' '))
+                old_tags = set(self._original_state['tagnames'].split())
             else:
                 old_tags = set()
-            new_tags = set(name for name in self.tagnames.split(u' ') if name)
+            new_tags = set(self.tagnames.split())
 
             return dict(
                     current=list(new_tags),
index 5592c4b1da39a2534290af62c0ff1bd6bc1d7bd1..912697b5cf63131b36eb23eabb8e8e541a702280 100644 (file)
@@ -27,7 +27,7 @@ class Tag(BaseModel):
         app_label = 'forum'
 
     def __unicode__(self):
-        return smart_unicode(self.name)
+        return unicode(self.name)
 
     def add_to_usage_count(self, value):
         if self.used_count + value < 0: