Skip to content

Commit

Permalink
feat: add discussion settings to course index api (#34174)
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera authored Feb 5, 2024
1 parent f7cd677 commit 6edc0c2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6edc0c2

Please sign in to comment.