Skip to content

Commit

Permalink
fix: [AXIMST-26] added block_type inside unit's children (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzniaievdm authored and monteri committed Jan 24, 2024
1 parent d0d737f commit 8331b41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class ChildVerticalContainerSerializer(serializers.Serializer):

name = serializers.CharField(source="display_name_with_default")
block_id = serializers.CharField(source="location")
block_type = serializers.CharField(source="location.block_type")


class VerticalContainerSerializer(serializers.Serializer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ def test_children_content(self):
{
"name": self.html_unit_first.display_name_with_default,
"block_id": str(self.html_unit_first.location),
"block_type": self.html_unit_first.location.block_type,
},
{
"name": self.html_unit_second.display_name_with_default,
"block_id": str(self.html_unit_second.location),
"block_type": self.html_unit_second.location.block_type,
},
]
self.assertEqual(response.data["children"], expected_response)
Expand Down
11 changes: 7 additions & 4 deletions cms/djangoapps/contentstore/rest_api/v1/views/vertical_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,19 @@ def get(self, request: Request, usage_key_string: str):
"children": [
{
"name": "Drag and Drop",
"block_id": "block-v1:org+101+101+type@drag-and-drop-v2+block@7599275ace6b46f5a482078a2954ca16"
"block_id": "block-v1:org+101+101+type@drag-and-drop-v2+block@7599275ace6b46f5a482078a2954ca16",
"block_type": "drag-and-drop-v2"
},
{
"name": "Video",
"block_id": "block-v1:org+101+101+type@video+block@0e3d39b12d7c4345981bda6b3511a9bf"
"block_id": "block-v1:org+101+101+type@video+block@0e3d39b12d7c4345981bda6b3511a9bf",
"block_type": "video"
},
{
"name": "Text",
"block_id": "block-v1:org+101+101+type@html+block@3e3fa1f88adb4a108cd14e9002143690"
}
"block_id": "block-v1:org+101+101+type@html+block@3e3fa1f88adb4a108cd14e9002143690",
"block_type": "html"
},
],
"is_published": false
}
Expand Down

0 comments on commit 8331b41

Please sign in to comment.