From 3fbf052968d29fce92eacdaf0da34ce188a8ff16 Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Fri, 15 Dec 2023 16:53:00 -0500 Subject: [PATCH] feat: return hide_from_toc field in course blocks --- lms/djangoapps/course_api/blocks/serializers.py | 1 + lms/djangoapps/course_home_api/outline/serializers.py | 1 + openedx/features/course_experience/utils.py | 1 + 3 files changed, 3 insertions(+) diff --git a/lms/djangoapps/course_api/blocks/serializers.py b/lms/djangoapps/course_api/blocks/serializers.py index ac031600a02c..666724e357af 100644 --- a/lms/djangoapps/course_api/blocks/serializers.py +++ b/lms/djangoapps/course_api/blocks/serializers.py @@ -57,6 +57,7 @@ def __init__( SupportedFieldType('has_scheduled_content'), SupportedFieldType('weight'), SupportedFieldType('show_correctness'), + SupportedFieldType('hide_from_toc'), # 'student_view_data' SupportedFieldType(StudentViewTransformer.STUDENT_VIEW_DATA, StudentViewTransformer), # 'student_view_multi_device' diff --git a/lms/djangoapps/course_home_api/outline/serializers.py b/lms/djangoapps/course_home_api/outline/serializers.py index 29b46d30e967..db6cbdf3a1ab 100644 --- a/lms/djangoapps/course_home_api/outline/serializers.py +++ b/lms/djangoapps/course_home_api/outline/serializers.py @@ -54,6 +54,7 @@ def get_blocks(self, block): # pylint: disable=missing-function-docstring 'resume_block': block.get('resume_block', False), 'type': block_type, 'has_scheduled_content': block.get('has_scheduled_content'), + 'hide_from_toc': block.get('hide_from_toc'), }, } for child in children: diff --git a/openedx/features/course_experience/utils.py b/openedx/features/course_experience/utils.py index d58b54f6139f..4675d0a974e0 100644 --- a/openedx/features/course_experience/utils.py +++ b/openedx/features/course_experience/utils.py @@ -115,6 +115,7 @@ def recurse_mark_auth_denial(block): 'completion', 'complete', 'resume_block', + 'hide_from_toc', ], allow_start_dates_in_future=allow_start_dates_in_future, )