Skip to content

Commit 1bbcd14

Browse files
committed
fix: qa
1 parent 2f89c6c commit 1bbcd14

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

backend/openedx_ai_extensions/processors/content_libraries_utils.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
from django.db import transaction
88
from opaque_keys.edx.locator import LibraryLocatorV2
9-
from openedx.core.djangoapps.content_libraries import api, permissions # pylint: disable=import-error
10-
from openedx.core.djangoapps.content_libraries.rest_api import serializers # pylint: disable=import-error
119

1210
logger = logging.getLogger(__name__)
1311

@@ -48,6 +46,10 @@ def create_collection_and_add_items(self, items, title, description="") -> str:
4846

4947
def create_block(self, data):
5048
"""Create a library block."""
49+
# pylint: disable=import-error, import-outside-toplevel
50+
from openedx.core.djangoapps.content_libraries import api
51+
from openedx.core.djangoapps.content_libraries.rest_api import serializers
52+
5153
serializer = serializers.LibraryXBlockCreationSerializer(data=data)
5254
serializer.is_valid(raise_exception=True)
5355

@@ -60,10 +62,16 @@ def create_block(self, data):
6062

6163
def modify_block_olx(self, usage_key, data):
6264
"""Modify the OLX of a library block."""
65+
# pylint: disable=import-error, import-outside-toplevel
66+
from openedx.core.djangoapps.content_libraries import api
67+
6368
api.set_library_block_olx(usage_key, data)
6469

6570
def create_collection(self, title, description="") -> None:
6671
"""Create a collection in the library."""
72+
# pylint: disable=import-error, import-outside-toplevel
73+
from openedx.core.djangoapps.content_libraries import api, permissions
74+
6775
content_library = api.require_permission_for_library_key(
6876
self.library_key, self.user, permissions.CAN_EDIT_THIS_CONTENT_LIBRARY
6977
)
@@ -81,6 +89,9 @@ def create_collection(self, title, description="") -> None:
8189
return collection
8290

8391
def update_library_collection_items(self, collection_key, item_keys) -> None:
92+
# pylint: disable=import-error, import-outside-toplevel
93+
from openedx.core.djangoapps.content_libraries import api
94+
8495
api.update_library_collection_items(
8596
library_key=self.library_key,
8697
collection_key=collection_key,

0 commit comments

Comments
 (0)