From d59c61415c196261fd93f6f8da09c8d10e3c94db Mon Sep 17 00:00:00 2001 From: andrey-canon Date: Mon, 29 Apr 2024 11:50:35 -0500 Subject: [PATCH] fix: use get_library_blocks instead of get_library_components --- .../content_tagging/helpers/objecttag_export_helpers.py | 6 +----- .../content_tagging/tests/test_objecttag_export_helpers.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/openedx/core/djangoapps/content_tagging/helpers/objecttag_export_helpers.py b/openedx/core/djangoapps/content_tagging/helpers/objecttag_export_helpers.py index cb7865e136c6..d367d08cd5a2 100644 --- a/openedx/core/djangoapps/content_tagging/helpers/objecttag_export_helpers.py +++ b/openedx/core/djangoapps/content_tagging/helpers/objecttag_export_helpers.py @@ -86,11 +86,7 @@ def _get_library_tagged_object_and_children( children=None, ) - library_components = library_api.get_library_components(library_key) - children = [ - library_api.LibraryXBlockMetadata.from_component(library_key, component) - for component in library_components - ] + children = library_api.get_library_blocks(library_key) return tagged_library, children diff --git a/openedx/core/djangoapps/content_tagging/tests/test_objecttag_export_helpers.py b/openedx/core/djangoapps/content_tagging/tests/test_objecttag_export_helpers.py index dff8828371cc..bf420995048a 100644 --- a/openedx/core/djangoapps/content_tagging/tests/test_objecttag_export_helpers.py +++ b/openedx/core/djangoapps/content_tagging/tests/test_objecttag_export_helpers.py @@ -446,7 +446,7 @@ def test_build_library_object_tree(self) -> None: """ Test if we can export a library """ - with self.assertNumQueries(8): + with self.assertNumQueries(11): tagged_library = build_object_tree_with_objecttags(self.library.key, self.all_library_object_tags) assert tagged_library == self.expected_library_tagged_xblock