]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixes OSQA-663, the user.username property should pass through the smart_unicode...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 3 May 2011 18:30:47 +0000 (18:30 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 3 May 2011 18:30:47 +0000 (18:30 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1019 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/user.py
forum/skins/default/templates/subscription_status.html

index b5bef173c3e2e0a1d5ff39c2e442e0729ab7ba7f..ae8f9387d2d4fe82d492595eb98722ad9f2f9c63 100644 (file)
@@ -205,7 +205,11 @@ class User(BaseModel, DjangoUser):
 
     @models.permalink
     def get_asked_url(self):
-        return ('user_questions', (), {'mode': _('asked-by'), 'user': self.id, 'slug': slugify(self.username)})
+        return ('user_questions', (), {'mode': _('asked-by'), 'user': self.id, 'slug': slugify(smart_unicode(self.username))})
+
+    @models.permalink
+    def get_user_subscriptions_url(self):
+        return ('user_subscriptions', (), { 'id': self.id, 'slug': slugify(smart_unicode(self.username))})
 
     @models.permalink
     def get_answered_url(self):
index d97dccd4e361c97b2426c442846b8e04376e011c..49ec02f7ec10ed365824d255d222bee0afadc7df 100644 (file)
@@ -22,8 +22,7 @@
         {% endif %}\r
     </a></p>\r
     <p>\r
-        {% url user_subscriptions id=request.user.id,slug=request.user.username|slugify as subscriptions_url %}\r
-        {% blocktrans %}\r
+        {% blocktrans with request.user.get_user_subscriptions_url as subscriptions_url %}\r
             (you can adjust your notification settings on your <a href="{{ subscriptions_url }}">profile</a>)\r
         {% endblocktrans %}\r
     </p>\r