Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Oct 7, 2024
1 parent 47cb6f4 commit eb7d2d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/content_libraries/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ def set_library_component_collections(
created_by: int | None = None,
# As an optimization, callers may pass in a pre-fetched ContentLibrary instance
content_library: ContentLibrary | None = None,
) -> Collection:
) -> Component:
"""
It Associates the component with collections for the given collection keys.
Expand Down
7 changes: 5 additions & 2 deletions openedx/core/djangoapps/content_libraries/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,11 @@ def patch(self, request, usage_key_str) -> Response:
Collection and Components must all be part of the given library/learning package.
"""
key = LibraryUsageLocatorV2.from_string(usage_key_str)
content_library = api.require_permission_for_library_key(key.lib_key, request.user,
permissions.CAN_EDIT_THIS_CONTENT_LIBRARY)
content_library = api.require_permission_for_library_key(
key.lib_key,
request.user,
permissions.CAN_EDIT_THIS_CONTENT_LIBRARY
)
component = api.get_component_from_usage_key(key)
serializer = ContentLibraryComponentCollectionsUpdateSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
Expand Down

0 comments on commit eb7d2d1

Please sign in to comment.