diff --git a/lms/envs/common.py b/lms/envs/common.py index 63c7aefb44..2c86287770 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -4009,9 +4009,20 @@ SEARCH_RESULT_PROCESSOR = "lms.lib.courseware_search.lms_result_processor.LmsSea SEARCH_FILTER_GENERATOR = "lms.lib.courseware_search.lms_filter_generator.LmsSearchFilterGenerator" # Override to skip enrollment start date filtering in course search SEARCH_SKIP_ENROLLMENT_START_DATE_FILTERING = False -# Override to skip excluding invitation-only courses in course search +# .. toggle_name: SEARCH_SKIP_INVITATION_ONLY_FILTERING +# .. toggle_implementation: DjangoSetting +# .. toggle_default: True +# .. toggle_description: If enabled, invitation-only courses will appear in search results. +# .. toggle_use_cases: open_edx +# .. toggle_creation_date: 2021-08-27 SEARCH_SKIP_INVITATION_ONLY_FILTERING = True -# Override to skip excluding non-catalog courses in course search +# .. toggle_name: SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING +# .. toggle_implementation: DjangoSetting +# .. toggle_default: True +# .. toggle_description: If enabled, courses with a catalog_visibility set to "none" will still +# appear in search results. +# .. toggle_use_cases: open_edx +# .. toggle_creation_date: 2021-08-27 SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING = True # The configuration visibility of account fields. diff --git a/lms/envs/production.py b/lms/envs/production.py index a695b56615..46755ba430 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -730,11 +730,11 @@ if FEATURES.get('ENABLE_COURSEWARE_SEARCH') or \ SEARCH_SKIP_INVITATION_ONLY_FILTERING = ENV_TOKENS.get( 'SEARCH_SKIP_INVITATION_ONLY_FILTERING', - SEARCH_SKIP_INVITATION_ONLY_FILTERING + SEARCH_SKIP_INVITATION_ONLY_FILTERING, ) SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING = ENV_TOKENS.get( 'SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING', - SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING + SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING, ) # TODO: Once we have successfully upgraded to ES7, switch this back to ELASTIC_SEARCH_CONFIG. diff --git a/lms/lib/courseware_search/lms_filter_generator.py b/lms/lib/courseware_search/lms_filter_generator.py index 6fb880dc59..c4e5ab7ac7 100644 --- a/lms/lib/courseware_search/lms_filter_generator.py +++ b/lms/lib/courseware_search/lms_filter_generator.py @@ -53,9 +53,9 @@ class LmsSearchFilterGenerator(SearchFilterGenerator): if org_filter_out_set: exclude_dictionary['org'] = list(org_filter_out_set) - if not getattr(settings, "SEARCH_SKIP_INVITATION_ONLY_FILTERING", False): + if not getattr(settings, "SEARCH_SKIP_INVITATION_ONLY_FILTERING", True): exclude_dictionary['invitation_only'] = True - if not getattr(settings, "SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING", False): + if not getattr(settings, "SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING", True): exclude_dictionary['catalog_visibility'] = 'none' return exclude_dictionary