From abe396164cd45fb9ad356ef17e3cec39ae8dc327 Mon Sep 17 00:00:00 2001 From: christopher lee Date: Wed, 28 Dec 2016 18:35:34 -0500 Subject: [PATCH] Added block_id to course blocks API response. --- lms/djangoapps/course_api/blocks/serializers.py | 1 + lms/djangoapps/course_api/blocks/tests/test_serializers.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/course_api/blocks/serializers.py b/lms/djangoapps/course_api/blocks/serializers.py index 8e6cef9871..67c70b7e00 100644 --- a/lms/djangoapps/course_api/blocks/serializers.py +++ b/lms/djangoapps/course_api/blocks/serializers.py @@ -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)}, diff --git a/lms/djangoapps/course_api/blocks/tests/test_serializers.py b/lms/djangoapps/course_api/blocks/tests/test_serializers.py index af95a96d03..6c118ed3e6 100644 --- a/lms/djangoapps/course_api/blocks/tests/test_serializers.py +++ b/lms/djangoapps/course_api/blocks/tests/test_serializers.py @@ -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):