Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
Update models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
codiebeulaine committed Oct 10, 2018
1 parent 6efe5b9 commit 62a060f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion molo/surveys/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ def serve_questions(self, request):
# this will only return a page if there is a translation
page = get_translation_for(
[context['page']],
locale=request.LANGUAGE_CODE, site=request.site)[0]
locale=request.LANGUAGE_CODE, site=request.site)
if page:
page = page[0]
if not page.language.is_main_language:
# if there is a translation, redirect to the translated page
return redirect(page.url)
Expand Down

0 comments on commit 62a060f

Please sign in to comment.