From e33b0c7c77f20549fb2dd092623f260440500d82 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 24 Oct 2012 16:36:53 +0200 Subject: [PATCH] lang switcher set to main on 404 --- fnpdjango/templatetags/fnp_lang.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 -- 2.20.1