From 5d937b08e86f45fc6071356c3e50161c02a4d152 Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Fri, 17 Jan 2025 20:22:44 +0530 Subject: [PATCH] refactor: apply review suggestions --- openedx/core/djangoapps/content/course_overviews/signals.py | 4 ---- openedx/core/djangoapps/content_libraries/api.py | 3 +-- openedx/core/djangoapps/content_libraries/tasks.py | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/openedx/core/djangoapps/content/course_overviews/signals.py b/openedx/core/djangoapps/content/course_overviews/signals.py index 4de13bcf88d..5412e3ebc01 100644 --- a/openedx/core/djangoapps/content/course_overviews/signals.py +++ b/openedx/core/djangoapps/content/course_overviews/signals.py @@ -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 - # ) diff --git a/openedx/core/djangoapps/content_libraries/api.py b/openedx/core/djangoapps/content_libraries/api.py index 8cd98f3cdd6..23299a22d53 100644 --- a/openedx/core/djangoapps/content_libraries/api.py +++ b/openedx/core/djangoapps/content_libraries/api.py @@ -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, diff --git a/openedx/core/djangoapps/content_libraries/tasks.py b/openedx/core/djangoapps/content_libraries/tasks.py index ffb088f611b..55a2329681e 100644 --- a/openedx/core/djangoapps/content_libraries/tasks.py +++ b/openedx/core/djangoapps/content_libraries/tasks.py @@ -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