Skip to content

Commit

Permalink
fixup! feat(content-libraries): single component publish api
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVZ96 committed Oct 21, 2024
1 parent 2295877 commit 335611a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions openedx/core/djangoapps/content_libraries/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,17 +1218,19 @@ def publish_changes(library_key, user_id=None):
)
)


def publish_component_changes(usage_key: LibraryUsageLocatorV2, user):
"""
Publish all pending changes in a single component.
"""
content_library = require_permission_for_library_key(
usage_key.lib_key,
user,
permissions.CAN_EDIT_THIS_CONTENT_LIBRARY
)
usage_key.lib_key,
user,
permissions.CAN_EDIT_THIS_CONTENT_LIBRARY
)
learning_package = content_library.learning_package

assert learning_package
component = get_component_from_usage_key(usage_key)
drafts_to_publish = authoring_api.get_all_drafts(learning_package.id).filter(
entity__key=component.key
Expand All @@ -1241,6 +1243,7 @@ def publish_component_changes(usage_key: LibraryUsageLocatorV2, user):
)
)


def revert_changes(library_key):
"""
Revert all pending changes to the specified library, restoring it to the
Expand Down

0 comments on commit 335611a

Please sign in to comment.