Merge pull request #14233 from edx/clee/block_id

Added block_id to course blocks API response.
This commit is contained in:
Christopher Lee
2017-01-03 12:53:00 -05:00
committed by GitHub
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):