-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle paste of library content blocks correctly #33926
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,15 @@ | |
from edx_rest_api_client.client import OAuthAPIClient | ||
|
||
from openedx.core.djangoapps.content_libraries import permissions | ||
from openedx.core.djangoapps.content_libraries.constants import DRAFT_NAME, COMPLEX | ||
# pylint: disable=unused-import | ||
from openedx.core.djangoapps.content_libraries.constants import ( | ||
ALL_RIGHTS_RESERVED, | ||
CC_4_BY, | ||
COMPLEX, | ||
DRAFT_NAME, | ||
PROBLEM, | ||
VIDEO, | ||
) | ||
from openedx.core.djangoapps.content_libraries.library_bundle import LibraryBundle | ||
from openedx.core.djangoapps.content_libraries.models import ( | ||
ContentLibrary, | ||
|
@@ -387,8 +395,15 @@ def get_library(library_key): | |
|
||
|
||
def create_library( | ||
collection_uuid, library_type, org, slug, title, description, allow_public_learning, allow_public_read, | ||
library_license, | ||
collection_uuid, | ||
org, | ||
slug, | ||
title, | ||
description="", | ||
allow_public_learning=False, | ||
allow_public_read=False, | ||
library_license=ALL_RIGHTS_RESERVED, | ||
library_type=COMPLEX, | ||
): | ||
Comment on lines
397
to
407
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏻 👍🏻 |
||
""" | ||
Create a new content library. | ||
|
@@ -405,6 +420,8 @@ def create_library( | |
|
||
allow_public_read: Allow anyone to view blocks (including source) in Studio? | ||
|
||
library_type: Deprecated parameter, not really used. Set to COMPLEX. | ||
|
||
Comment on lines
+423
to
+424
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing this out. We should either do something library types or rip them out. Let's talk to product about this before the next phase of work. I added an item to #33640 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I've heard, product wants to rip them out. |
||
Returns a ContentLibraryMetadata instance. | ||
""" | ||
assert isinstance(collection_uuid, UUID) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit/Optional: using isinstance would make this bit pass type-checking, whenever we get around to enabling that for this module.
But, it also might create an import cycle. Up to you.