diff --git a/cms/urls.py b/cms/urls.py index 048339bc9fe9..ac73a808fa4f 100644 --- a/cms/urls.py +++ b/cms/urls.py @@ -9,6 +9,7 @@ from django.urls import path, re_path from django.utils.translation import gettext_lazy as _ from django.contrib import admin +from django.shortcuts import redirect from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView from auth_backends.urls import oauth2_urlpatterns from edx_api_doc_tools import make_docs_urls @@ -87,7 +88,7 @@ ), # Darklang View to change the preview language (or dark language) - path('update_lang/', include('openedx.core.djangoapps.dark_lang.urls', namespace='dark_lang')), + path('update_lang/', lambda request: redirect(f'{settings.LMS_ROOT_URL}/update_lang/')), # For redirecting to help pages. path('help_token/', include('help_tokens.urls')), diff --git a/openedx/core/djangoapps/dark_lang/tests.py b/openedx/core/djangoapps/dark_lang/tests.py index 765d2ea3091f..eec458925f0b 100644 --- a/openedx/core/djangoapps/dark_lang/tests.py +++ b/openedx/core/djangoapps/dark_lang/tests.py @@ -251,6 +251,9 @@ def _post_set_preview_lang(self, preview_language): """ Sends a post request to set the preview language """ + # @@TODO make this call set_user_preference, + # and then have a small separate LMS-only test class just to call the + # POST and ensure it sets the user preference. return self.client.post('/update_lang/', {'preview_language': preview_language, 'action': 'set_preview_language'}) # lint-amnesty, pylint: disable=line-too-long def _post_clear_preview_lang(self):