From 859ca146e6196602a9bc1727a467454ce035ea4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrey=20Ca=C3=B1on?= <36200299+andrey-canon@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:26:34 -0500 Subject: [PATCH] feat: add course type field to advanced settings and course info index (#41) (cherry picked from commit 8697c96e23d0384a6a44b098e965980be3b50b73) --- cms/djangoapps/contentstore/courseware_index.py | 1 + xmodule/course_block.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/cms/djangoapps/contentstore/courseware_index.py b/cms/djangoapps/contentstore/courseware_index.py index dc28774c50f7..b42074eb5056 100644 --- a/cms/djangoapps/contentstore/courseware_index.py +++ b/cms/djangoapps/contentstore/courseware_index.py @@ -589,6 +589,7 @@ class CourseAboutSearchIndexer(CoursewareSearchIndexer): AboutInfo("language", AboutInfo.PROPERTY, AboutInfo.FROM_COURSE_PROPERTY), AboutInfo("invitation_only", AboutInfo.PROPERTY, AboutInfo.FROM_COURSE_PROPERTY), AboutInfo("catalog_visibility", AboutInfo.PROPERTY, AboutInfo.FROM_COURSE_PROPERTY), + AboutInfo("course_type", AboutInfo.ANALYSE | AboutInfo.PROPERTY, AboutInfo.FROM_COURSE_PROPERTY), ] @classmethod diff --git a/xmodule/course_block.py b/xmodule/course_block.py index a74abdb3f617..28a32334398b 100644 --- a/xmodule/course_block.py +++ b/xmodule/course_block.py @@ -1059,6 +1059,15 @@ class CourseFields: # lint-amnesty, pylint: disable=missing-class-docstring scope=Scope.settings ) + course_type = String( + display_name=_("Course Type"), + help=_( + "Content type that helps the student to filter courses which are more interesting for them." + ), + default=None, + scope=Scope.settings, + ) + class CourseBlock( CourseFields,