From 69078f3eed5903c9be465f0bf72d634fb7dbaa4f Mon Sep 17 00:00:00 2001 From: Glib Glugovskiy Date: Sat, 10 Aug 2024 16:11:53 +0300 Subject: [PATCH] refactor: change name of the policy to course push optout --- openedx/core/djangoapps/ace_common/settings/common.py | 2 +- openedx/core/djangoapps/ace_common/settings/production.py | 2 +- openedx/core/djangoapps/notifications/policies.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openedx/core/djangoapps/ace_common/settings/common.py b/openedx/core/djangoapps/ace_common/settings/common.py index 993412f392..634ab328ba 100644 --- a/openedx/core/djangoapps/ace_common/settings/common.py +++ b/openedx/core/djangoapps/ace_common/settings/common.py @@ -40,7 +40,7 @@ def plugin_settings(settings): # lint-amnesty, pylint: disable=missing-function if getattr(settings, 'FIREBASE_APP', None): settings.ACE_ENABLED_CHANNELS.append(settings.ACE_CHANNEL_DEFAULT_PUSH) - settings.ACE_ENABLED_POLICIES.append('bulk_push_notification_optout') + settings.ACE_ENABLED_POLICIES.append('course_push_notification_optout') settings.PUSH_NOTIFICATIONS_SETTINGS = { 'CONFIG': 'push_notifications.conf.AppConfig', diff --git a/openedx/core/djangoapps/ace_common/settings/production.py b/openedx/core/djangoapps/ace_common/settings/production.py index 48da799f00..9ff5629201 100644 --- a/openedx/core/djangoapps/ace_common/settings/production.py +++ b/openedx/core/djangoapps/ace_common/settings/production.py @@ -38,7 +38,7 @@ def plugin_settings(settings): ) if settings.FIREBASE_APP: settings.ACE_ENABLED_CHANNELS.append(settings.ACE_CHANNEL_DEFAULT_PUSH) - settings.ACE_ENABLED_POLICIES.append('bulk_push_notification_optout') + settings.ACE_ENABLED_POLICIES.append('course_push_notification_optout') settings.PUSH_NOTIFICATIONS_SETTINGS = { 'CONFIG': 'push_notifications.conf.AppConfig', diff --git a/openedx/core/djangoapps/notifications/policies.py b/openedx/core/djangoapps/notifications/policies.py index 8467eda932..8d0a2d8d43 100644 --- a/openedx/core/djangoapps/notifications/policies.py +++ b/openedx/core/djangoapps/notifications/policies.py @@ -16,7 +16,7 @@ class CoursePushNotificationOptout(Policy): """ Check if the user has opted out of push notifications for the given course. :param message: - :return: + :return: PolicyResult """ course_ids = message.context.get('course_ids', []) app_label = message.context.get('app_label') diff --git a/setup.py b/setup.py index 55863c5d07..28a25cc914 100644 --- a/setup.py +++ b/setup.py @@ -130,7 +130,7 @@ setup( ], "openedx.ace.policy": [ "bulk_email_optout = lms.djangoapps.bulk_email.policies:CourseEmailOptout", - "bulk_push_notification_optout = openedx.core.djangoapps.notifications.policies:CoursePushNotificationOptout", # lint-amnesty, pylint: disable=line-too-long + "course_push_notification_optout = openedx.core.djangoapps.notifications.policies:CoursePushNotificationOptout", # lint-amnesty, pylint: disable=line-too-long ], "openedx.call_to_action": [ "personalized_learner_schedules = openedx.features.personalized_learner_schedules.call_to_action:PersonalizedLearnerScheduleCallToAction" # lint-amnesty, pylint: disable=line-too-long