From 060c9bef81217f785c4118478ddd39cb1eea2953 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Tue, 8 Nov 2016 13:28:48 +0100 Subject: [PATCH 1/1] fix in language setting (bad 404) --- fnpdjango/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fnpdjango/middleware.py b/fnpdjango/middleware.py index fcf4c36..adf0dc8 100644 --- a/fnpdjango/middleware.py +++ b/fnpdjango/middleware.py @@ -20,11 +20,11 @@ class URLLocaleMiddleware(object): def process_request(self, request): language = translation.get_language_from_path(request.path_info) - if language == settings.LANGUAGE_CODE: - raise Http404 if language: translation.activate(language) request.LANGUAGE_CODE = translation.get_language() + if language == settings.LANGUAGE_CODE: + raise Http404 def process_response(self, request, response): language = translation.get_language() -- 2.20.1