-
Notifications
You must be signed in to change notification settings - Fork 3
Description
This pull request refactors the feature flag logic for notifications and email notifications throughout the codebase. The main change is switching from "enable" waffle flags (e.g., ENABLE_NOTIFICATIONS, ENABLE_EMAIL_NOTIFICATIONS) to "disable" waffle flags (e.g., DISABLE_NOTIFICATIONS, DISABLE_EMAIL_NOTIFICATIONS). This means that the features are now enabled by default unless explicitly disabled by the corresponding flag. The update includes changes in both application logic and test cases to use the new flags and invert the logic where necessary.
Key changes include:
Feature flag implementation and usage updates:
Replaced ENABLE_NOTIFICATIONS and ENABLE_EMAIL_NOTIFICATIONS with DISABLE_NOTIFICATIONS and DISABLE_EMAIL_NOTIFICATIONS in openedx/core/djangoapps/notifications/config/waffle.py, including updating flag names, documentation, and logic. The new flags now disable the respective features when enabled, instead of enabling them.
Updated all application logic in notification and discussion-related tasks to check for the "disable" flags (DISABLE_NOTIFICATIONS, DISABLE_EMAIL_NOTIFICATIONS) and invert the logic accordingly, so features are active unless the flag is enabled.
Test updates:
Refactored all test cases to use the new "disable" flags, removing or inverting any @override_waffle_flag(ENABLE_NOTIFICATIONS, ...) and @override_waffle_flag(ENABLE_EMAIL_NOTIFICATIONS, ...) decorators and logic. Updated assertions to match the new default-enabled behavior.
These changes simplify feature management by making notifications and email notifications enabled by default, and only disabled when the respective "disable" flag is set. This also makes the codebase more consistent and easier to reason about
Metadata
Metadata
Assignees
Labels
Type
Projects
Status