Skip to content

Commit

Permalink
fix: use the published version's created date as component last_publi…
Browse files Browse the repository at this point in the history
…shed

instead of the publish log, which is only populated for the parent
library, not each component.
  • Loading branch information
pomegranited committed Jul 27, 2024
1 parent 8d0ada5 commit f8b8634
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions openedx/core/djangoapps/content_libraries/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ def from_component(cls, library_key, component):
"""
Construct a LibraryXBlockMetadata from a Component object.
"""
last_publish_log = authoring_api.get_last_publish(component.pk)

return cls(
usage_key=LibraryUsageLocatorV2(
library_key,
Expand All @@ -217,7 +215,7 @@ def from_component(cls, library_key, component):
display_name=component.versioning.draft.title,
created=component.created,
modified=component.versioning.draft.created,
last_published=None if last_publish_log is None else last_publish_log.published_at,
last_published=component.versioning.published.created if component.versioning.published else None,
has_unpublished_changes=component.versioning.has_unpublished_changes
)

Expand Down

0 comments on commit f8b8634

Please sign in to comment.