From 5409baa5f8ef9c07294a7857ae327c06cdaf222c Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Wed, 23 Jul 2025 23:24:13 +0530 Subject: [PATCH] feat: include upstream_info for all xblocks including sections and subsections (#37041) --- .../contentstore/xblock_storage_handlers/view_handlers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py index ef190cece1..d75d481ad6 100644 --- a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py +++ b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py @@ -1303,13 +1303,12 @@ def create_xblock_info( # lint-amnesty, pylint: disable=too-many-statements # Update with gating info xblock_info.update(_get_gating_info(course, xblock)) + # Also add upstream info + xblock_info["upstream_info"] = UpstreamLink.try_get_for_block(xblock, log_error=False).to_json() if is_xblock_unit: # if xblock is a Unit we add the discussion_enabled option xblock_info["discussion_enabled"] = xblock.discussion_enabled - # Also add upstream info - xblock_info["upstream_info"] = UpstreamLink.try_get_for_block(xblock, log_error=False).to_json() - if xblock.category == "sequential": # Entrance exam subsection should be hidden. in_entrance_exam is # inherited metadata, all children will have it.