Skip to content

Commit b4539a4

Browse files
committed
refactor: check for upstream_version
1 parent 6a93b06 commit b4539a4

File tree

1 file changed

+2
-2
lines changed
  • openedx/core/djangoapps/content_libraries

1 file changed

+2
-2
lines changed

openedx/core/djangoapps/content_libraries/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ def create_or_update_xblock_upstream_link(usage_key):
182182
"""
183183
ensure_cms("create_or_update_xblock_upstream_link may only be executed in a CMS context")
184184
xblock = modulestore().get_item(UsageKey.from_string(usage_key))
185-
if not xblock.upstream:
186-
TASK_LOGGER.info(f"No upstream found for xblock: {xblock.usage_key}")
185+
if not xblock.upstream or not xblock.upstream_version:
186+
TASK_LOGGER.info(f"No upstream or upstream_version found for xblock: {xblock.usage_key}")
187187
return
188188
try:
189189
course_name = CourseOverview.get_from_id(xblock.course_id).display_name_with_default

0 commit comments

Comments
 (0)