]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/users.py
Resolves Jira OSQA-732, check twice for NoReverseMatch exceptions, try passing only...
[osqa.git] / 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