From: Radek Czajka Date: Wed, 24 Oct 2012 14:36:53 +0000 (+0200) Subject: lang switcher set to main on 404 X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/e33b0c7c77f20549fb2dd092623f260440500d82?ds=inline lang switcher set to main on 404 --- diff --git a/fnpdjango/templatetags/fnp_lang.py b/fnpdjango/templatetags/fnp_lang.py index 7f08496..006faec 100755 --- a/fnpdjango/templatetags/fnp_lang.py +++ b/fnpdjango/templatetags/fnp_lang.py @@ -35,17 +35,14 @@ def get_here_url(request, lang): try: match = resolve(request.get_full_path()) except Resolver404: - return None + match = resolve('/') view = match.url_name if view is None: view = match.func if lang is None: lang = translation.get_language() with translation.override(lang): - try: - url = reverse(view, args=match.args, kwargs=match.kwargs) - except Resolver404: - return None + url = reverse(view, args=match.args, kwargs=match.kwargs) return url