Use view_name instead of func

Using func does not work when using application with namespace url.
This commit is contained in:
Rodolphe Breard 2018-03-02 19:32:56 +01:00
parent 01c9651131
commit 98947a358e

View file

@ -25,7 +25,7 @@ def get_lang_data(path_info, lang_code, curr_lang):
lang_name = get_lang_name(lang_code) lang_name = get_lang_name(lang_code)
rm = resolve(path_info) rm = resolve(path_info)
activate_lang(lang_code) 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) activate_lang(curr_lang)
return (lang_code, lang_name, lang_url) return (lang_code, lang_name, lang_url)