Skip to content

Commit

Permalink
fix: library ref management cmds course id call (openedx#33477)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayzhou-bit authored Oct 11, 2023
1 parent 95b658c commit 526db10
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def add_arguments(self, parser):
def replace_all_library_source_blocks_ids(self, v1_to_v2_lib_map):
"""A method to replace 'source_library_id' in all relevant blocks."""

courses = CourseOverview.get_all_courses()
course_id_strings = [str(course.id) for course in courses]
course_id_strings = CourseOverview.get_all_course_keys()

# Use Celery to distribute the workload
tasks = group(
Expand All @@ -58,8 +57,7 @@ def replace_all_library_source_blocks_ids(self, v1_to_v2_lib_map):

def validate(self, v1_to_v2_lib_map):
""" Validate that replace_all_library_source_blocks_ids was successful"""
courses = CourseOverview.get_all_courses()
course_id_strings = [str(course.id) for course in courses]
course_id_strings = 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()

Expand All @@ -81,8 +79,7 @@ def validate(self, v1_to_v2_lib_map):

def undo(self, v1_to_v2_lib_map):
""" undo the changes made by replace_all_library_source_blocks_ids"""
courses = CourseOverview.get_all_courses()
course_id_strings = [str(course.id) for course in courses]
course_id_strings = CourseOverview.get_all_course_keys()

# Use Celery to distribute the workload
tasks = group(
Expand Down

0 comments on commit 526db10

Please sign in to comment.