diff --git a/cms/djangoapps/contentstore/rest_api/v1/serializers/course_index.py b/cms/djangoapps/contentstore/rest_api/v1/serializers/course_index.py index 45fb976b73e5..29577d9a75b5 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/serializers/course_index.py +++ b/cms/djangoapps/contentstore/rest_api/v1/serializers/course_index.py @@ -20,6 +20,7 @@ class CourseIndexSerializer(serializers.Serializer): deprecated_blocks_info = serializers.DictField() discussions_incontext_feedback_url = serializers.CharField() discussions_incontext_learnmore_url = serializers.CharField() + discussions_settings = serializers.DictField() initial_state = InitialIndexStateSerializer() initial_user_clipboard = serializers.DictField() language_code = serializers.CharField() @@ -29,4 +30,5 @@ class CourseIndexSerializer(serializers.Serializer): proctoring_errors = ProctoringErrorListSerializer(many=True) reindex_link = serializers.CharField() rerun_notification_id = serializers.IntegerField() + advance_settings_url = serializers.CharField() is_custom_relative_dates_active = serializers.BooleanField() diff --git a/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py b/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py index 29c61a167675..c9ff5f9c36e3 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py @@ -77,7 +77,13 @@ def test_course_index_response(self): "notification_dismiss_url": None, "proctoring_errors": [], "reindex_link": f"/course/{self.course.id}/search_reindex", - "rerun_notification_id": None + "rerun_notification_id": None, + "discussions_settings": { + "enable_in_context": True, + "enable_graded_units": False, + "unit_level_visibility": True, + }, + "advance_settings_url": f"/settings/advanced/{self.course.id}", } self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -117,7 +123,13 @@ def test_course_index_response_with_show_locators(self): "notification_dismiss_url": None, "proctoring_errors": [], "reindex_link": f"/course/{self.course.id}/search_reindex", - "rerun_notification_id": None + "rerun_notification_id": None, + "discussions_settings": { + "enable_in_context": True, + "enable_graded_units": False, + "unit_level_visibility": True, + }, + "advance_settings_url": f"/settings/advanced/{self.course.id}", } self.assertEqual(response.status_code, status.HTTP_200_OK) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index 3b0be88d4d6b..91e85f8df660 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -1760,6 +1760,7 @@ def _get_course_index_context(request, course_key, course_block): course_index_context = { 'language_code': request.LANGUAGE_CODE, 'context_course': course_block, + 'discussions_settings': course_block.discussions_settings, 'lms_link': lms_link, 'sections': sections, 'course_structure': course_structure,