From 98947a358e0f90877dfb11af73aa510254857b8b Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Fri, 2 Mar 2018 19:32:56 +0100 Subject: [PATCH] Use view_name instead of func Using func does not work when using application with namespace url. --- navbar/templatetags/navbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/navbar/templatetags/navbar.py b/navbar/templatetags/navbar.py index e6935b1..d1be843 100644 --- a/navbar/templatetags/navbar.py +++ b/navbar/templatetags/navbar.py @@ -25,7 +25,7 @@ def get_lang_data(path_info, lang_code, curr_lang): lang_name = get_lang_name(lang_code) rm = resolve(path_info) activate_lang(lang_code) - lang_url = reverse(rm.func, args=rm.args, kwargs=rm.kwargs) + lang_url = reverse(rm.view_name, current_app='npb', args=rm.args, kwargs=rm.kwargs) activate_lang(curr_lang) return (lang_code, lang_name, lang_url)