Skip to content
Closed
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
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/lang_pref/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def process_request(self, request):
if LANGUAGE_SESSION_KEY in request.session and request.session[LANGUAGE_SESSION_KEY] != cookie_lang:
del request.session[LANGUAGE_SESSION_KEY]

# Apply language specified in SiteConfiguration, ignoring user preferences.
if language := get_value('LANGUAGE_CODE'):
# Apply language specified in SiteConfiguration, if there are not user preferences.
if (language := get_value('LANGUAGE_CODE')) and (not request.COOKIES.get(settings.LANGUAGE_COOKIE_NAME, None)):
request.COOKIES[settings.LANGUAGE_COOKIE_NAME] = language

def process_response(self, request, response): # lint-amnesty, pylint: disable=missing-function-docstring
Expand Down