]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/registry.py
do not show user bio if user is suspended
[osqa.git] / forum / registry.py
index ec973895e546aa70904168e993651d07fbf67554..871f1e5d0eccf65f036106cb495b50d2b3346a4b 100644 (file)
@@ -4,6 +4,7 @@ from django.utils.encoding import smart_unicode
 from django.core.urlresolvers import reverse
 from django.template.defaultfilters import slugify
 
 from django.core.urlresolvers import reverse
 from django.template.defaultfilters import slugify
 
+from forum.models import User
 from forum.templatetags.extra_tags import get_score_badge
 from forum.utils.html import cleanup_urls
 from forum import settings
 from forum.templatetags.extra_tags import get_score_badge
 from forum.utils.html import cleanup_urls
 from forum import settings
@@ -70,7 +71,10 @@ class SuperUserSwitchMenuItem(ui.UserMenuItem):
 ui.register(ui.USER_MENU,
             ui.UserMenuItem(
                 label=_("edit profile"),
 ui.register(ui.USER_MENU,
             ui.UserMenuItem(
                 label=_("edit profile"),
-                url=lambda u, c: reverse('edit_user', kwargs={'id': c['user'].id}),
+                url=lambda u, c: reverse('edit_user', kwargs={
+                    'id': c['user'].id,
+                    'slug' : slugify(c['user'].username)
+                }),
                 span_attrs={'class': 'user-edit'},
                 weight=0,
                 name='EDIT_PROFILE'
                 span_attrs={'class': 'user-edit'},
                 weight=0,
                 name='EDIT_PROFILE'
@@ -84,7 +88,7 @@ ui.register(ui.USER_MENU,
             ),
             ui.UserMenuItem(
                 label=_("email notification settings"),
             ),
             ui.UserMenuItem(
                 label=_("email notification settings"),
-                url=lambda u, c: reverse('user_subscriptions', kwargs={'id': c['user'].id, 'slug': slugify(c['user'].username)}),
+                url=lambda u, c: User.objects.get(id=int(c['user'].id)).get_user_subscriptions_url(),
                 span_attrs={'class': 'user-subscriptions'},
                 weight=200,
                 name='EMAIL_SETTINGS'
                 span_attrs={'class': 'user-subscriptions'},
                 weight=200,
                 name='EMAIL_SETTINGS'