From 2033dcf6ace133719aaeb72dc5dd6ee521a7ac42 Mon Sep 17 00:00:00 2001 From: Raymond Zhou <56318341+rayzhou-bit@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:06:30 -0700 Subject: [PATCH] fix: ref mgmt cmd logging (#33481) --- .../commands/replace_v1_lib_refs_with_v2_in_courses.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/management/commands/replace_v1_lib_refs_with_v2_in_courses.py b/cms/djangoapps/contentstore/management/commands/replace_v1_lib_refs_with_v2_in_courses.py index 727f340abf..6c19a89cf3 100644 --- a/cms/djangoapps/contentstore/management/commands/replace_v1_lib_refs_with_v2_in_courses.py +++ b/cms/djangoapps/contentstore/management/commands/replace_v1_lib_refs_with_v2_in_courses.py @@ -34,7 +34,11 @@ class Command(BaseCommand): def replace_all_library_source_blocks_ids(self, v1_to_v2_lib_map): """A method to replace 'source_library_id' in all relevant blocks.""" - course_id_strings = CourseOverview.get_all_course_keys() + course_id_strings = list(CourseOverview.get_all_course_keys()) + + # Following is used for debugging and should be removed + for course_id_string in course_id_strings: + log.info(course_id_string) # Use Celery to distribute the workload tasks = group( @@ -57,7 +61,7 @@ class Command(BaseCommand): def validate(self, v1_to_v2_lib_map): """ Validate that replace_all_library_source_blocks_ids was successful""" - course_id_strings = CourseOverview.get_all_course_keys() + course_id_strings = list(CourseOverview.get_all_course_keys()) tasks = group(validate_all_library_source_blocks_ids_for_course.s(course_id, v1_to_v2_lib_map) for course_id in course_id_strings) # lint-amnesty, pylint: disable=line-too-long results = tasks.apply_async() @@ -79,7 +83,7 @@ class Command(BaseCommand): def undo(self, v1_to_v2_lib_map): """ undo the changes made by replace_all_library_source_blocks_ids""" - course_id_strings = CourseOverview.get_all_course_keys() + course_id_strings = list(CourseOverview.get_all_course_keys()) # Use Celery to distribute the workload tasks = group(