feat: keep learner state associated after libraries migration (#33920)

* fix: preserve learner state after v2 migration

Co-authored-by: Kyle McCormick <kyle@axim.org>

---------

Co-authored-by: Kyle McCormick <kyle@axim.org>
This commit is contained in:
connorhaugh
2023-12-18 15:14:28 -05:00
committed by GitHub
parent 9e14fa4ac3
commit 2eac2ef638
3 changed files with 49 additions and 18 deletions

View File

@@ -896,14 +896,15 @@ def _create_copy_content_task(v2_library_key, v1_library_key):
spin up a celery task to import the V1 Library's content into the V2 library.
This utalizes the fact that course and v1 library content is stored almost identically.
"""
return v2contentlib_api.import_blocks_create_task(v2_library_key, v1_library_key)
return v2contentlib_api.import_blocks_create_task(
v2_library_key, v1_library_key,
use_course_key_as_block_id_suffix=False
)
def _create_metadata(v1_library_key, collection_uuid):
"""instansiate an index for the V2 lib in the collection"""
print(collection_uuid)
store = modulestore()
v1_library = store.get_library(v1_library_key)
collection = get_collection(collection_uuid).uuid