]> git.openstreetmap.org Git - osqa.git/commitdiff
Resolves Jira OSQA-732, check twice for NoReverseMatch exceptions, try passing only...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 1 Aug 2011 10:48:10 +0000 (10:48 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 1 Aug 2011 10:48:10 +0000 (10:48 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1144 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/views/users.py

index cf9b3732a363bc4f857e57f80820b67d860d6a88..82e817560cfbc9b3b053b847752c7394e1e8399e 100644 (file)
@@ -305,7 +305,10 @@ def user_view(template, tab_name, tab_title, tab_description, private=False, tab
                 try:\r
                     return reverse(fn.__name__, kwargs={'id': vu.id, 'slug': slugify(smart_unicode(vu.username))})\r
                 except NoReverseMatch:\r
-                    return reverse(fn.__name__, kwargs={'id': vu.id})\r
+                    try:\r
+                        return reverse(fn.__name__, kwargs={'id': vu.id})\r
+                    except NoReverseMatch:\r
+                        return reverse(fn.__name__, kwargs={'slug': slugify(smart_unicode(vu.username))})\r
 \r
             ui.register(ui.PROFILE_TABS, ui.ProfileTab(\r
                 tab_name, tab_title, tab_description,url_getter, private, render_to, weight\r