X-Git-Url: https://git.mdrn.pl/fnpdjango.git/blobdiff_plain/3db2da0f3aecda70b20c05bcde42e30353dceb05..a97799592b2a5e6217d175d8aea4eb0cf6632a2d:/fnpdjango/middleware.py 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()