From: jordan Date: Mon, 1 Aug 2011 10:48:10 +0000 (+0000) Subject: Resolves Jira OSQA-732, check twice for NoReverseMatch exceptions, try passing only... X-Git-Tag: live~169 X-Git-Url: https://git.openstreetmap.org/osqa.git/commitdiff_plain/7a6498fcb87f1e544af26946fa27668081bea78b Resolves Jira OSQA-732, check twice for NoReverseMatch exceptions, try passing only the slug as an argument, this was causing the 'overview' tab in the user profile to disappear git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1144 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/views/users.py b/forum/views/users.py index cf9b373..82e8175 100644 --- a/forum/views/users.py +++ b/forum/views/users.py @@ -305,7 +305,10 @@ def user_view(template, tab_name, tab_title, tab_description, private=False, tab try: return reverse(fn.__name__, kwargs={'id': vu.id, 'slug': slugify(smart_unicode(vu.username))}) except NoReverseMatch: - return reverse(fn.__name__, kwargs={'id': vu.id}) + try: + return reverse(fn.__name__, kwargs={'id': vu.id}) + except NoReverseMatch: + return reverse(fn.__name__, kwargs={'slug': slugify(smart_unicode(vu.username))}) ui.register(ui.PROFILE_TABS, ui.ProfileTab( tab_name, tab_title, tab_description,url_getter, private, render_to, weight