Skip to content

Commit

Permalink
feat: add pr suggestion logic
Browse files Browse the repository at this point in the history
  • Loading branch information
johanseto committed Jan 26, 2024
1 parent 40322c6 commit 159ac19
Showing 1 changed file with 2 additions and 2 deletions.
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')) and (getattr(settings, "IGNORE_USER_LANGUAGE_COOKIE", True)):
# 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

0 comments on commit 159ac19

Please sign in to comment.