From 064ca62cdd2297e017cf950fd6dfd1cdfd5c0ae9 Mon Sep 17 00:00:00 2001 From: nsprenkle Date: Wed, 24 Sep 2025 13:40:11 -0400 Subject: [PATCH 1/2] fix: corrects naming of make_mako_template_dirs function --- docs/devstack_faq.rst | 6 +++--- provision-set-edx-theme.sh | 4 ++-- py_configuration_files/lms.py | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/devstack_faq.rst b/docs/devstack_faq.rst index 4d59280..0985df4 100644 --- a/docs/devstack_faq.rst +++ b/docs/devstack_faq.rst @@ -115,19 +115,19 @@ Make sure that you enable the following code in ./edx-platform/lms/envs/devstack # theme directories to COMPREHENSIVE_THEME_DIRS # We have to import the private method here because production.py calls - # derive_settings('lms.envs.production') which runs _make_mako_template_dirs with + # derive_settings('lms.envs.production') which runs make_mako_template_dirs with # the settings from production, which doesn't include these theming settings. Thus, # the templating engine is unable to find the themed templates because they don't exist # in it's path. Re-calling derive_settings doesn't work because the settings was already # changed from a function to a list, and it can't be derived again. - from .common import _make_mako_template_dirs + from .common import make_mako_template_dirs ENABLE_COMPREHENSIVE_THEMING = True COMPREHENSIVE_THEME_DIRS = [ "/edx/app/edxapp/edx-platform/themes/", "/edx/app/edx-themes/edx-platform/", ] - TEMPLATES[1]["DIRS"] = Derived(_make_mako_template_dirs) + TEMPLATES[1]["DIRS"] = Derived(make_mako_template_dirs) derive_settings(__name__) Enabling a theme diff --git a/provision-set-edx-theme.sh b/provision-set-edx-theme.sh index cf49f2e..33e91af 100755 --- a/provision-set-edx-theme.sh +++ b/provision-set-edx-theme.sh @@ -21,7 +21,7 @@ fi popd # Uncomment relevant lines in the devstack.py file -sed -i '' "s|^# from .common import _make_mako_template_dirs|from .common import _make_mako_template_dirs|" "$DEVSTACK_FILE" +sed -i '' "s|^# from .common import make_mako_template_dirs|from .common import make_mako_template_dirs|" "$DEVSTACK_FILE" sed -i '' "s|^# ENABLE_COMPREHENSIVE_THEMING = True|ENABLE_COMPREHENSIVE_THEMING = True|" "$DEVSTACK_FILE" sed -i '' "s|^# COMPREHENSIVE_THEME_DIRS = \[|COMPREHENSIVE_THEME_DIRS = \[|" "$DEVSTACK_FILE" sed -i '' "s|^# \"/edx/app/edxapp/edx-platform/themes/\"| \"/edx/app/edxapp/edx-platform/themes/\",|" "$DEVSTACK_FILE" @@ -29,7 +29,7 @@ sed -i '' "/COMPREHENSIVE_THEME_DIRS = \[/a\\ \"$THEME_DIR\", " "$DEVSTACK_FILE" sed -i '' "s|^# \]|]|" "$DEVSTACK_FILE" -sed -i '' "s|^# TEMPLATES\[1\]\[\"DIRS\"\] = Derived(_make_mako_template_dirs)|TEMPLATES[1][\"DIRS\"] = Derived(_make_mako_template_dirs)|" "$DEVSTACK_FILE" +sed -i '' "s|^# TEMPLATES\[1\]\[\"DIRS\"\] = Derived(make_mako_template_dirs)|TEMPLATES[1][\"DIRS\"] = Derived(make_mako_template_dirs)|" "$DEVSTACK_FILE" sed -i '' "s|^# derive_settings(__name__)|derive_settings(__name__)|" "$DEVSTACK_FILE" diff --git a/py_configuration_files/lms.py b/py_configuration_files/lms.py index e495cb2..44b94e8 100644 --- a/py_configuration_files/lms.py +++ b/py_configuration_files/lms.py @@ -484,18 +484,19 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing # theme directories to COMPREHENSIVE_THEME_DIRS # We have to import the private method here because production.py calls -# derive_settings('lms.envs.production') which runs _make_mako_template_dirs with +# derive_settings('lms.envs.production') which runs make_mako_template_dirs with # the settings from production, which doesn't include these theming settings. Thus, # the templating engine is unable to find the themed templates because they don't exist # in it's path. Re-calling derive_settings doesn't work because the settings was already # changed from a function to a list, and it can't be derived again. -# from .common import _make_mako_template_dirs +# from .common import make_mako_template_dirs # ENABLE_COMPREHENSIVE_THEMING = True # COMPREHENSIVE_THEME_DIRS = [ +# "/edx/src/edx-themes/edx-platform", # "/edx/app/edxapp/edx-platform/themes/" # ] -# TEMPLATES[1]["DIRS"] = Derived(_make_mako_template_dirs) +# TEMPLATES[1]["DIRS"] = Derived(make_mako_template_dirs) # derive_settings(__name__) # Uncomment the lines below if you'd like to see SQL statements in your devstack LMS log. From c2111dcb3b8d0dae7a3a2838a375a996f977ccda Mon Sep 17 00:00:00 2001 From: Nathan Sprenkle Date: Wed, 24 Sep 2025 14:21:27 -0400 Subject: [PATCH 2/2] docs: update comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- py_configuration_files/lms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py_configuration_files/lms.py b/py_configuration_files/lms.py index 44b94e8..c3d35e1 100644 --- a/py_configuration_files/lms.py +++ b/py_configuration_files/lms.py @@ -483,7 +483,7 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing # If you want to enable theming in devstack, uncomment this section and add any relevant # theme directories to COMPREHENSIVE_THEME_DIRS -# We have to import the private method here because production.py calls +# We have to import the function here because production.py calls # derive_settings('lms.envs.production') which runs make_mako_template_dirs with # the settings from production, which doesn't include these theming settings. Thus, # the templating engine is unable to find the themed templates because they don't exist