X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/22236fb67da2f27ceb35ad138f4d534a4fd08251..212778ba10f8e0a23f576d1caa5cc2837e9e2c2d:/forum/registry.py diff --git a/forum/registry.py b/forum/registry.py index 43f11a7..871f1e5 100644 --- a/forum/registry.py +++ b/forum/registry.py @@ -1,8 +1,10 @@ from forum.modules import ui, get_modules_script from django.utils.translation import ugettext as _ +from django.utils.encoding import smart_unicode 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 @@ -29,7 +31,7 @@ ui.register(ui.HEADER_LINKS, ui.Link( visibility=ui.Visibility.AUTHENTICATED, - text=lambda u, c: u.username, + text=lambda u, c: smart_unicode(u.username), url=lambda u, c: u.get_profile_url(), post_code=lambda u, c: get_score_badge(u), weight=100, name='ACCOUNT'), @@ -69,7 +71,10 @@ class SuperUserSwitchMenuItem(ui.UserMenuItem): 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' @@ -83,7 +88,7 @@ ui.register(ui.USER_MENU, ), 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'