From a6aaaa69da534cfffaed3b7aa6bbe2dacd868459 Mon Sep 17 00:00:00 2001 From: "Kyle D. McCormick" Date: Tue, 25 Jun 2024 17:56:19 -0400 Subject: [PATCH] feat: add version_num to LibraryXBlockMetadata --- openedx/core/djangoapps/content_libraries/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/content_libraries/api.py b/openedx/core/djangoapps/content_libraries/api.py index 888452c89028..b4d10129f9a2 100644 --- a/openedx/core/djangoapps/content_libraries/api.py +++ b/openedx/core/djangoapps/content_libraries/api.py @@ -196,6 +196,7 @@ class LibraryXBlockMetadata: usage_key = attr.ib(type=LibraryUsageLocatorV2) created = attr.ib(type=datetime) modified = attr.ib(type=datetime) + version_num = attr.ib(type=int) display_name = attr.ib("") last_published = attr.ib(default=None, type=datetime) has_unpublished_changes = attr.ib(False) @@ -218,7 +219,8 @@ def from_component(cls, library_key, component): created=component.created, modified=component.versioning.draft.created, last_published=None if last_publish_log is None else last_publish_log.published_at, - has_unpublished_changes=component.versioning.has_unpublished_changes + has_unpublished_changes=component.versioning.has_unpublished_changes, + version_num=component.versioning.draft.version_num, )