From 29a285bddbb912751d836ea42d2013de87ab3d77 Mon Sep 17 00:00:00 2001 From: Kaustav Banerjee Date: Sat, 31 Aug 2024 14:48:07 +0530 Subject: [PATCH] feat: in-context discussion for units can be disabled by default --- cms/envs/common.py | 8 ++++++++ xmodule/vertical_block.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index d4159ec98dde..ac29857ac5a8 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -592,6 +592,14 @@ # .. toggle_creation_date: 2024-04-10 'BADGES_ENABLED': False, + # .. toggle_name: FEATURES['IN_CONTEXT_DISCUSSION_ENABLED_DEFAULT'] + # .. toggle_implementation: DjangoSetting + # .. toggle_default: True + # .. toggle_description: Set to False to not enable in-context discussion for units by default. + # .. toggle_use_cases: open_edx + # .. toggle_creation_date: 2024-09-02 + 'IN_CONTEXT_DISCUSSION_ENABLED_DEFAULT': True, + # .. toggle_name: FEATURES['ENABLE_LEGACY_MD5_HASH_FOR_ANONYMOUS_USER_ID'] # .. toggle_implementation: DjangoSetting # .. toggle_default: False diff --git a/xmodule/vertical_block.py b/xmodule/vertical_block.py index 2a10ae44497f..b03aa5a42dfb 100644 --- a/xmodule/vertical_block.py +++ b/xmodule/vertical_block.py @@ -9,6 +9,7 @@ from functools import reduce import pytz +from django.conf import settings from lxml import etree from openedx_filters.learning.filters import VerticalBlockChildRenderStarted, VerticalBlockRenderCompleted from web_fragments.fragment import Fragment @@ -43,7 +44,7 @@ class VerticalFields: discussion_enabled = Boolean( display_name=_("Enable in-context discussions for the Unit"), help=_("Add discussion for the Unit."), - default=True, + default=settings.FEATURES.get('IN_CONTEXT_DISCUSSION_ENABLED_DEFAULT', True), scope=Scope.settings, )