From be000d128c670c891b5afa2b232dadb8d74df70f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 02:35:23 +0000 Subject: [PATCH 1/2] Initial plan From 0df61c565c1d13aa85f705a7fb72d0b3f1c496ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 02:45:36 +0000 Subject: [PATCH 2/2] fix: make enterprise DashboardContextEnricher fail-safe and add context defaults After PR #38094 removed enterprise context variables from student_dashboard() in favor of a DashboardContextEnricher filter pipeline, two issues remained: 1. fail_silently: False could crash the entire dashboard if the enricher is unavailable or fails 2. enterprise_message and enterprise_learner_portal_enabled_message had no explicit defaults in the context dict Changes: - lms/envs/common.py: Changed fail_silently: False to fail_silently: True for DashboardContextEnricher to prevent dashboard crashes - dashboard.py: Added explicit empty-string defaults for enterprise context variables so the template contract is always satisfied Agent-Logs-Url: https://github.com/openedx/openedx-platform/sessions/9dfd421a-df10-4df0-a99f-70d73ea5378e Co-authored-by: kiram15 <31229189+kiram15@users.noreply.github.com> --- common/djangoapps/student/views/dashboard.py | 2 ++ lms/envs/common.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/student/views/dashboard.py b/common/djangoapps/student/views/dashboard.py index d38a3c3c3407..994f2336eb51 100644 --- a/common/djangoapps/student/views/dashboard.py +++ b/common/djangoapps/student/views/dashboard.py @@ -790,6 +790,8 @@ def student_dashboard(request): # pylint: disable=too-many-statements context = { 'urls': urls, 'programs_data': programs_data, + 'enterprise_message': '', + 'enterprise_learner_portal_enabled_message': '', '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"], }, }