Skip to content

Commit 0af3759

Browse files
committed
feat: add version_num to LibraryXBlockMetadata
1 parent 8d0ada5 commit 0af3759

File tree

1 file changed

+3
-1
lines changed
  • openedx/core/djangoapps/content_libraries

1 file changed

+3
-1
lines changed

openedx/core/djangoapps/content_libraries/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class LibraryXBlockMetadata:
196196
usage_key = attr.ib(type=LibraryUsageLocatorV2)
197197
created = attr.ib(type=datetime)
198198
modified = attr.ib(type=datetime)
199+
version_num = attr.ib(type=int)
199200
display_name = attr.ib("")
200201
last_published = attr.ib(default=None, type=datetime)
201202
has_unpublished_changes = attr.ib(False)
@@ -218,7 +219,8 @@ def from_component(cls, library_key, component):
218219
created=component.created,
219220
modified=component.versioning.draft.created,
220221
last_published=None if last_publish_log is None else last_publish_log.published_at,
221-
has_unpublished_changes=component.versioning.has_unpublished_changes
222+
has_unpublished_changes=component.versioning.has_unpublished_changes,
223+
version_num=component.versioning.draft.version_num,
222224
)
223225

224226

0 commit comments

Comments
 (0)