From bb7a91efc7c0f46c74cbf1cc4c599d252911447f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Thu, 19 Sep 2024 14:10:29 -0300 Subject: [PATCH] feat: return modified field on get component endpoint --- openedx/core/djangoapps/content_libraries/serializers.py | 1 + .../djangoapps/content_libraries/tests/test_content_libraries.py | 1 + 2 files changed, 2 insertions(+) diff --git a/openedx/core/djangoapps/content_libraries/serializers.py b/openedx/core/djangoapps/content_libraries/serializers.py index e9e04646ace4..51ba55cd6b48 100644 --- a/openedx/core/djangoapps/content_libraries/serializers.py +++ b/openedx/core/djangoapps/content_libraries/serializers.py @@ -154,6 +154,7 @@ class LibraryXBlockMetadataSerializer(serializers.Serializer): last_draft_created_by = serializers.CharField(read_only=True) has_unpublished_changes = serializers.BooleanField(read_only=True) created = serializers.DateTimeField(format=DATETIME_FORMAT, read_only=True) + modified = serializers.DateTimeField(format=DATETIME_FORMAT, read_only=True) # When creating a new XBlock in a library, the slug becomes the ID part of # the definition key and usage key: diff --git a/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py b/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py index 677178bb3b31..37435a402702 100644 --- a/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py +++ b/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py @@ -1046,6 +1046,7 @@ def test_library_paste_clipboard(self): # Check that the new block was created after the paste and it's content matches # the the block in the clipboard + block_data["created"] = paste_data["created"] # The created date will be different self.assertDictContainsEntries(self._get_library_block(paste_data["id"]), { **block_data, "last_draft_created_by": None,