feat: include upstream_info for all xblocks including sections and subsections (#37041)

This commit is contained in:
Navin Karkera
2025-07-23 23:24:13 +05:30
committed by GitHub
parent a7a7a5b6f0
commit 5409baa5f8

View File

@@ -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.