fnp
/
fnpdjango.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e7c406b
)
fix in language setting (bad 404)
0.2.2
author
Jan Szejko
<janek37@gmail.com>
Tue, 8 Nov 2016 12:28:48 +0000
(13:28 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 8 Nov 2016 12:28:48 +0000
(13:28 +0100)
fnpdjango/middleware.py
patch
|
blob
|
history
diff --git
a/fnpdjango/middleware.py
b/fnpdjango/middleware.py
index
fcf4c36
..
adf0dc8
100644
(file)
--- 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)
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:
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()
def process_response(self, request, response):
language = translation.get_language()