Skip to content

Commit

Permalink
Merge pull request #5344 from benjaoming/release-note
Browse files Browse the repository at this point in the history
Comments and release notes about #5342
  • Loading branch information
benjaoming authored Nov 28, 2016
2 parents 884b26d + 9605a64 commit 950d1f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/installguide/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ New features

* New management command ``clearuserdata``, makes it easy to prepare a
prototype device for subsequent cloning. :url-issue:`5341`
* Patch from Rachel means you can now go to a specific page in a specific
language:
``/api/i18n/set_default_language/?lang=es&returnUrl=/learn/khan/math``
:url-issue:`5342` -
(Thanks: Jonathan Field)

Bug fixes
^^^^^^^^^
Expand Down
6 changes: 3 additions & 3 deletions kalite/i18n/api_views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import json

from django.conf import settings; logging = settings.LOG
from django.utils.translation import gettext as _
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import redirect

from .base import get_default_language, set_default_language, set_request_language
from fle_utils.internet.classes import JsonResponse, JsonResponseMessageError
from fle_utils.internet.classes import JsonResponse
from fle_utils.internet.decorators import api_handle_error_with_json

@csrf_exempt
Expand Down Expand Up @@ -37,6 +36,8 @@ def set_server_or_user_default_language(request):
returnUrl = ''
allUsers = ''

# GET requests are used by RACHEL to jump to a specific page with the
# language already set so the user doesn't have to.
if request.method == 'GET':
data = request.GET
if not 'lang' in data:
Expand Down Expand Up @@ -68,4 +69,3 @@ def set_server_or_user_default_language(request):
return JsonResponse({"status": "OK"})
else:
return redirect(returnUrl)

0 comments on commit 950d1f0

Please sign in to comment.