Open jmakowski1123 opened 2 weeks ago
There's no Learning Core API to publish exactly one thing, but publish_drafts
accepts a QuerySet
of Drafts
. So with no changes to openedx-learning, we could do something like:
pe_key = pe_key_from_usage_key(usage_key) # I'm just making this up, but we have a mapping somewhere
drafts_to_publish = authoring.get_all_drafts(learning_package_id).filter(entity__key=pe_key)
authoring.publish_drafts(learning_package_id, drafts_to_publish, published_by=user.id)
@ormsbee I think you mean publish_from_drafts
? there's a publish_all_drafts
in the public learning core API, but publish_from_drafts
isn't public, it's just available for internal learning core apps. I can still do from openedx_learning.apps.authoring.publishing.api import publish_from_drafts
, but I guess it'd be better to add it to the exported functions inside __all__
right?
@DanielVZ96: Yes, I meant publish_from_drafts
, and I had forgotten that it wasn't public. Please feel free to tag me on the openedx-learning PR to make it public. Thank you.
The Publish component button (in the manage tab of the component sidebar) should be clickable in the following scenarios:
The Publish component button should not be clickable (grayed out, but still visible) in the following scenarios:
Expected behavior:
Syncing: