From 31c12deeed7cebe905bb92aa2c76a1bfa11f220f Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Thu, 19 Mar 2015 16:57:36 -0300 Subject: [PATCH] New Noosfero profile redirect --- colab/proxy/noosfero/apps.py | 6 ++---- colab/proxy/templatetags/proxy.py | 11 +---------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/colab/proxy/noosfero/apps.py b/colab/proxy/noosfero/apps.py index 03d9458..668b9c8 100644 --- a/colab/proxy/noosfero/apps.py +++ b/colab/proxy/noosfero/apps.py @@ -15,9 +15,7 @@ class ProxyNoosferoAppConfig(ColabProxiedAppConfig): (_('Communities'), 'search/communities'), ), 'auth_links': ( - (_('Profile'), 'profile/{0}'), - (_('Control panel'), 'myprofile/{0}'), + (_('Profile'), 'profile/~/'), + (_('Control panel'), 'myprofile/~/'), ), } - - arguments = ["context['user']"] diff --git a/colab/proxy/templatetags/proxy.py b/colab/proxy/templatetags/proxy.py index 886f82c..9b83a34 100644 --- a/colab/proxy/templatetags/proxy.py +++ b/colab/proxy/templatetags/proxy.py @@ -37,17 +37,8 @@ def proxy_menu(context): if title not in menu_links: menu_links[title] = [] - is_authenticated = context['request'].user.is_authenticated() - if hasattr(app, 'arguments') and is_authenticated: - arguments = app.arguments - else: - arguments = [] - - for i, _ in enumerate(arguments): - arguments[i] = eval(arguments[i]) - for text, link in links: - url = reverse(app.label, args=(link.format(*arguments),)) + url = reverse(app.label, args=(link,)) menu_links[title].append((text, url)) menu = render_to_string('proxy/menu_template.html', -- libgit2 0.21.2