From 3e83efa6095eb857b631f5cfef4d315bffeea580 Mon Sep 17 00:00:00 2001 From: Taylor Payne Date: Wed, 4 Jun 2025 11:38:30 -0600 Subject: [PATCH] fix: exclude fields from UpstreamSyncMixin in advanced settings api (#36831) The UpstreamSyncMixin introduced in [1] which is added as a XBlock mixin, currently contains four fields - `upstream`, `upstream_version`, `upstream_version_declined`, and `upstream_display_name`. These fields are coming through in the course advanced settings API endpoint (`/api/contentstore/v0/advanced_settings/{course_id}`), and subsequently show up in the Advanced Settings view in the frontend-app-authoring MFE, which they shouldn't. This PR resolves this issue by adding the fields from the `UpstreamSyncMixin` into the FIELDS_EXCLUDE_LIST [2] of the `CourseMetadata` class. Unless the API is called with `fetch_all=1` (the authoring MFE uses `fetch_all=0`), then these fields will be filtered out. [1] https://github.com/openedx/edx-platform/blob/master/cms/lib/xblock/upstream_sync.py#L289 [2] https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/models/settings/course_metadata.py#L41 Fixes: https://github.com/openedx/frontend-app-authoring/issues/2018 --- cms/djangoapps/models/settings/course_metadata.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cms/djangoapps/models/settings/course_metadata.py b/cms/djangoapps/models/settings/course_metadata.py index 5d4ac5a4a3..1cd87ed5a0 100644 --- a/cms/djangoapps/models/settings/course_metadata.py +++ b/cms/djangoapps/models/settings/course_metadata.py @@ -82,6 +82,10 @@ class CourseMetadata: 'is_onboarding_exam', 'discussions_settings', 'copied_from_block', + "upstream", + "upstream_version", + "upstream_version_declined", + "upstream_display_name", ] @classmethod