Skip to content

Commit

Permalink
refactor: apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Jan 17, 2025
1 parent bd9014a commit 5d937b0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions openedx/core/djangoapps/content/course_overviews/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,3 @@ def _check_for_display_name_change(previous_course_overview, updated_course_over
old_name=previous_course_overview.display_name_with_default,
new_name=updated_course_overview.display_name_with_default,
)
# update_course_name_in_upstream_links.delay(
# str(previous_course_overview.id),
# updated_course_overview.display_name_with_default
# )
3 changes: 1 addition & 2 deletions openedx/core/djangoapps/content_libraries/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1959,13 +1959,12 @@ def create_or_update_xblock_upstream_link(xblock, course_key: str, course_name:
Create or update upstream->downstream link in database for given xblock.
"""
if not xblock.upstream:
log.info(f"No upstream found for xblock: {xblock.usage_key}")
return None
upstream_usage_key = UsageKeyV2.from_string(xblock.upstream)
try:
lib_component = get_component_from_usage_key(upstream_usage_key)
except ObjectDoesNotExist:
log.exception("Library block not found!")
log.error(f"Library component not found for {upstream_usage_key}")
lib_component = None
authoring_api.update_or_create_entity_link(
lib_component,
Expand Down
1 change: 0 additions & 1 deletion openedx/core/djangoapps/content_libraries/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def create_or_update_xblock_upstream_link(usage_key):
ensure_cms("create_or_update_xblock_upstream_link may only be executed in a CMS context")
xblock = modulestore().get_item(UsageKey.from_string(usage_key))
if not xblock.upstream or not xblock.upstream_version:
TASK_LOGGER.info(f"No upstream or upstream_version found for xblock: {xblock.usage_key}")
return
try:
course_name = CourseOverview.get_from_id(xblock.course_id).display_name_with_default
Expand Down

0 comments on commit 5d937b0

Please sign in to comment.