From: Jan Szejko Date: Tue, 8 Nov 2016 12:28:48 +0000 (+0100) Subject: fix in language setting (bad 404) X-Git-Tag: 0.2.2 X-Git-Url: https://git.mdrn.pl/fnpdjango.git/commitdiff_plain/060c9bef81217f785c4118478ddd39cb1eea2953?ds=sidebyside;hp=e7c406b88401d0d19aaa46bab8c24c01fb58455d fix in language setting (bad 404) --- 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()