From ea0b4a62d580649afa57cc933b61adc402d5aec4 Mon Sep 17 00:00:00 2001 From: Max Sokolski Date: Fri, 8 Oct 2021 00:45:13 +0300 Subject: [PATCH] fix: LANGUAGE_COOKIE_NAME is not set by default Regression caused by https://github.com/edx/edx-platform/pull/28796 Details: ``` response.delete_cookie( settings.LANGUAGE_COOKIE_NAME, domain=settings.SHARED_COOKIE_DOMAIN ) caused an Exception due to absence of LANGUAGE_COOKIE_NAME settings variable > production.py LANGUAGE_COOKIE_NAME = ENV_TOKENS.get('LANGUAGE_COOKIE', None) or ENV_TOKENS.get('LANGUAGE_COOKIE_NAME') ``` --- tutor/templates/apps/openedx/config/cms.env.json | 1 + tutor/templates/apps/openedx/config/lms.env.json | 1 + tutor/templates/config.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/tutor/templates/apps/openedx/config/cms.env.json b/tutor/templates/apps/openedx/config/cms.env.json index 32aea1bab79..c909590fc92 100644 --- a/tutor/templates/apps/openedx/config/cms.env.json +++ b/tutor/templates/apps/openedx/config/cms.env.json @@ -35,6 +35,7 @@ "EMAIL_USE_TLS": {{ "true" if SMTP_USE_TLS else "false" }}, "HTTPS": "{{ "on" if ENABLE_HTTPS else "off" }}", "LANGUAGE_CODE": "{{ LANGUAGE_CODE }}", + "LANGUAGE_COOKIE_NAME": "{{ LANGUAGE_COOKIE_NAME }}", "SESSION_COOKIE_DOMAIN": ".{{ LMS_HOST|common_domain(CMS_HOST) }}", {{ patch("cms-env", separator=",\n", suffix=",")|indent(2) }} "CACHES": { diff --git a/tutor/templates/apps/openedx/config/lms.env.json b/tutor/templates/apps/openedx/config/lms.env.json index 15a2b129037..0a856c50871 100644 --- a/tutor/templates/apps/openedx/config/lms.env.json +++ b/tutor/templates/apps/openedx/config/lms.env.json @@ -45,6 +45,7 @@ "ACE_ROUTING_KEY": "edx.lms.core.default", "HTTPS": "{{ "on" if ENABLE_HTTPS else "off" }}", "LANGUAGE_CODE": "{{ LANGUAGE_CODE }}", + "LANGUAGE_COOKIE_NAME": "{{ LANGUAGE_COOKIE_NAME }}", "SESSION_COOKIE_DOMAIN": ".{{ LMS_HOST|common_domain(CMS_HOST) }}", {{ patch("lms-env", separator=",\n", suffix=",")|indent(2) }} "CACHES": { diff --git a/tutor/templates/config.yml b/tutor/templates/config.yml index 8360b357ed6..6b085448c21 100644 --- a/tutor/templates/config.yml +++ b/tutor/templates/config.yml @@ -48,6 +48,7 @@ JWT_COMMON_SECRET_KEY: "{{ OPENEDX_SECRET_KEY }}" JWT_RSA_PRIVATE_KEY: "{{ 2048|rsa_private_key }}" K8S_NAMESPACE: "openedx" LANGUAGE_CODE: "en" +LANGUAGE_COOKIE_NAME: "openedx-language-preference" MONGODB_HOST: "mongodb" MONGODB_DATABASE: "openedx" MONGODB_PORT: 27017