Skip to content

Commit

Permalink
fixes #1549 endless redirect if browser language is not a cms language
Browse files Browse the repository at this point in the history
Conflicts:
	cms/views.py
  • Loading branch information
stefanfoulis committed Dec 20, 2012
1 parent 9c70a95 commit 389fa3a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cms/views.py
Expand Up @@ -60,9 +60,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:
Expand Down

0 comments on commit 389fa3a

Please sign in to comment.