From c51f0dad000f1468fabc30a33975b3dcbf4b775e Mon Sep 17 00:00:00 2001 From: Eugene Dyudyunov Date: Tue, 7 Mar 2023 10:28:04 +0200 Subject: [PATCH] chore: disable forum digest subscription section by default (#31459) Current State of the feature Initially, this feature used the Notifier Django app but was deprecated and removed from the configuration in favor of edx-notifications. More info about this deprecation can be found in the GitHub issue ( https://github.com/openedx/build-test-release-wg/issues/22). The edx-notifications app was not supported though, so its repository was archived and moved to openedx-unsupported/edx-notifications. Check the deprecation ticket (https://github.com/openedx/edx-notifications/issues/253) and corresponding discussion (https://discuss.openedx.org/t/deprecation-removal-edx-notifications-repository/6748) for details. What remains in the edx-platform The forum initial page contains the how-to info with the notification preferences toggle. This section is responsible for toggling the "notification_pref" user preference (aka NOTIFICATION_PREF_KEY). I didn't find any usage of this preference across the platform, so I'm suggesting hiding it by default by setting the ENABLE_FORUM_DAILY_DIGEST setting to `False`. --- lms/djangoapps/discussion/config/settings.py | 4 ++-- lms/djangoapps/discussion/notification_prefs/tests.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/discussion/config/settings.py b/lms/djangoapps/discussion/config/settings.py index 946754cb1b..76e4ad7594 100644 --- a/lms/djangoapps/discussion/config/settings.py +++ b/lms/djangoapps/discussion/config/settings.py @@ -5,7 +5,7 @@ from django.conf import settings # .. toggle_name: FEATURES['ENABLE_FORUM_DAILY_DIGEST'] # .. toggle_implementation: DjangoSetting -# .. toggle_default: True +# .. toggle_default: False # .. toggle_description: Settings for forums/discussions to on/off daily digest # feature. Set this to True if you want to enable users to subscribe and unsubscribe # for daily digest. This setting enables deprecation of daily digest. @@ -16,4 +16,4 @@ ENABLE_FORUM_DAILY_DIGEST = 'enable_forum_daily_digest' def is_forum_daily_digest_enabled(): """Returns whether forum notification features should be visible""" - return settings.FEATURES.get('ENABLE_FORUM_DAILY_DIGEST', True) + return settings.FEATURES.get('ENABLE_FORUM_DAILY_DIGEST', False) diff --git a/lms/djangoapps/discussion/notification_prefs/tests.py b/lms/djangoapps/discussion/notification_prefs/tests.py index 75c0b86bb8..ea775185af 100644 --- a/lms/djangoapps/discussion/notification_prefs/tests.py +++ b/lms/djangoapps/discussion/notification_prefs/tests.py @@ -28,6 +28,7 @@ class NotificationPrefViewTest(UrlResetMixin, TestCase): # lint-amnesty, pylint INITIALIZATION_VECTOR = b"\x00" * 16 @patch.dict("django.conf.settings.FEATURES", {"ENABLE_DISCUSSION_SERVICE": True}) + @patch.dict("django.conf.settings.FEATURES", {"ENABLE_FORUM_DAILY_DIGEST": True}) def setUp(self): super().setUp() self.user = UserFactory.create(username="testuser")