Added block_id to course blocks API response.

This commit is contained in:
christopher lee
2016-12-28 18:35:34 -05:00
parent 9e5139dcb0
commit abe396164c
2 changed files with 2 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ class BlockSerializer(serializers.Serializer): # pylint: disable=abstract-metho
# create response data dict for basic fields
data = {
'id': unicode(block_key),
'block_id': unicode(block_key.block_id),
'lms_web_url': reverse(
'jump_to',
kwargs={'course_id': unicode(block_key.course_key), 'location': unicode(block_key)},

View File

@@ -64,7 +64,7 @@ class TestBlockSerializerBase(SharedModuleStoreTestCase):
)
self.assertEquals(
set(serialized_block.iterkeys()),
{'id', 'type', 'lms_web_url', 'student_view_url'},
{'id', 'block_id', 'type', 'lms_web_url', 'student_view_url'},
)
def add_additional_requested_fields(self, context=None):