From 1f152ee3fa6b24464d744bed6124200b6d6ff6e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 02:49:54 +0000 Subject: [PATCH 1/2] Initial plan From 8b5632c69057a2c548b0054c8d7facdfddf93eca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 02:56:39 +0000 Subject: [PATCH 2/2] fix: add safe enterprise context defaults to prevent stale Mako cache crashes Agent-Logs-Url: https://github.com/openedx/openedx-platform/sessions/9f1afa3c-8e4e-45be-b752-62cb9fd8bb5b Co-authored-by: kiram15 <31229189+kiram15@users.noreply.github.com> --- common/djangoapps/student/views/dashboard.py | 9 +++++++++ lms/envs/common.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/student/views/dashboard.py b/common/djangoapps/student/views/dashboard.py index d38a3c3c3407..69d0814ac0e4 100644 --- a/common/djangoapps/student/views/dashboard.py +++ b/common/djangoapps/student/views/dashboard.py @@ -790,6 +790,15 @@ def student_dashboard(request): # pylint: disable=too-many-statements context = { 'urls': urls, 'programs_data': programs_data, + # These enterprise-related keys are populated by DashboardContextEnricher (via DashboardRenderStarted filter) + # when the enterprise package is installed. Safe defaults are provided here so that: + # 1. The template renders safely on non-enterprise deployments. + # 2. Any stale compiled Mako cache that still references consent_required_courses (from before + # PR #38094 removed that line) will not crash with "argument of type 'Undefined' is not iterable". + 'enterprise_message': '', + 'consent_required_courses': set(), + 'enterprise_learner_portal_enabled_message': None, + 'banner_account_activation_message': None, 'enrollment_message': enrollment_message, 'redirect_message': Text(redirect_message), 'account_activation_messages': account_activation_messages, diff --git a/lms/envs/common.py b/lms/envs/common.py index 3b7133836d9c..2b6bbdaf551a 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3292,7 +3292,7 @@ def _should_send_certificate_events(settings): "pipeline": ["enterprise.filters.accounts.AccountSettingsReadOnlyFieldsStep"], }, "org.openedx.learning.dashboard.render.started.v1": { - "fail_silently": False, + "fail_silently": True, "pipeline": ["enterprise.filters.dashboard.DashboardContextEnricher"], }, }