Skip to content
Browse files

Merge pull request #1566 from stefanfoulis/feature/issue-1549-endless…

…-redirect-with-setting-overrides

fixes #1549 endless redirect if browser language is not a cms language
  • Loading branch information...
2 parents 654b666 + 389fa3a commit 2d5256701cad36bdc2a349adae4ebc59d2aac02f @stefanfoulis stefanfoulis committed Dec 20, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 cms/views.py
View
7 cms/views.py
@@ -63,9 +63,10 @@ def details(request, slug):
with SettingsOverride(LANGUAGES=languages, LANGUAGE_CODE=languages[0][0]):
#get supported language
new_language = translation.get_language_from_request(request)
- with force_language(new_language):
- pages_root = reverse('pages-root')
- return HttpResponseRedirect(pages_root + attrs)
+ if new_language in get_public_languages():
+ with force_language(new_language):
+ pages_root = reverse('pages-root')
+ return HttpResponseRedirect(pages_root + attrs)
else:
_handle_no_page(request, slug)
else:

0 comments on commit 2d52567

Please sign in to comment.
Something went wrong with that request. Please try again.