From 834384c88eecf0c2fd3f32bfe054d0bf49660e87 Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Mon, 1 Apr 2024 17:47:57 +0500 Subject: [PATCH] fix: runtim id_generator issue --- cms/djangoapps/contentstore/helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/helpers.py b/cms/djangoapps/contentstore/helpers.py index c824b9d6dc..935ce7f170 100644 --- a/cms/djangoapps/contentstore/helpers.py +++ b/cms/djangoapps/contentstore/helpers.py @@ -316,9 +316,9 @@ def _import_xml_node_to_parent( block_type = node.tag # Generate the new ID: - id_generator = ImportIdGenerator(parent_key.context_key) - def_id = id_generator.create_definition(block_type, slug_hint) - usage_id = id_generator.create_usage(def_id) + runtime.id_generator = ImportIdGenerator(parent_key.context_key) + def_id = runtime.id_generator.create_definition(block_type, slug_hint) + usage_id = runtime.id_generator.create_usage(def_id) keys = ScopeIds(None, block_type, def_id, usage_id) # parse_xml is a really messy API. We pass both 'keys' and 'id_generator' and, depending on the XBlock, either # one may be used to determine the new XBlock's usage key, and the other will be ignored. e.g. video ignores