Skip to content

feat: Only display Preview Language Setting (dark_lang) in LMS #36271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')),
Expand Down
3 changes: 3 additions & 0 deletions openedx/core/djangoapps/dark_lang/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading