Skip to content

Commit

Permalink
fix: handle case where there is no published verison
Browse files Browse the repository at this point in the history
  • Loading branch information
ormsbee committed Nov 16, 2023
1 parent db4e42e commit 6bdacf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openedx/core/djangoapps/content_libraries/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,10 @@ def get_library_block_learning_core(usage_key):
component__local_key=usage_key.block_id,
)
draft_version = entity.draft.version
published_version = entity.published.version
if hasattr(entity, 'published'):
published_version = entity.published.version
else:
published_version = None

return LibraryXBlockMetadata(
usage_key=usage_key,
Expand Down

0 comments on commit 6bdacf9

Please sign in to comment.