]> git.openstreetmap.org Git - osqa.git/commitdiff
OSQA-650, force unicode when using the __unicode__ method in the Tags model and make...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 13 Apr 2011 17:46:39 +0000 (17:46 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 13 Apr 2011 17:46:39 +0000 (17:46 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@977 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/tag.py
forum/views/readers.py

index 912697b5cf63131b36eb23eabb8e8e541a702280..067488b2f97ca6bc77c6a6f9cca25c281ceb6070 100644 (file)
@@ -2,7 +2,7 @@ import datetime
 from base import *
 
 from django.utils.translation import ugettext as _
-from django.utils.encoding import smart_unicode
+from django.utils.encoding import smart_unicode, force_unicode
 
 from forum import modules
 
@@ -27,7 +27,7 @@ class Tag(BaseModel):
         app_label = 'forum'
 
     def __unicode__(self):
-        return unicode(self.name)
+        return force_unicode(self.name)
 
     def add_to_usage_count(self, value):
         if self.used_count + value < 0:
index 2878424e29703bee4dc546386e6a305f1820fe98..e8004875018ed889d23cad8b419482d808fc46d6 100644 (file)
@@ -108,7 +108,7 @@ def tag(request, tag):
         raise Http404
 
     # Getting the questions QuerySet
-    questions = Question.objects.filter(tags__name=smart_unicode(tag.name))
+    questions = Question.objects.filter(tags__id=tag.id)
 
     if request.method == "GET":
         user = request.GET.get('user', None)