Skip to content

refactor: Remove no-op ENABLE_FORUM_DAILY_DIGEST definition#38245

Open
kdmccormick wants to merge 2 commits intomasterfrom
kdmccormick/enable-forum-daily-digest
Open

refactor: Remove no-op ENABLE_FORUM_DAILY_DIGEST definition#38245
kdmccormick wants to merge 2 commits intomasterfrom
kdmccormick/enable-forum-daily-digest

Conversation

@kdmccormick
Copy link
Copy Markdown
Member

This line was likely added here with the intent of defining an edx-toggles-style FeatureToggle object. Instead, it just declares a local variable named ENABLE_FORUM_DAILY_DIGEST, whereas the actual check occurs at either of:

  • settings.ENABLE_FORUM_DAILY_DIGEST # new way
  • settings.FEATURES['ENABLE_FORUM_DAILY_DIGEST'] # old way

The local variable can be safely removed, reducing confusion.

The toggle annotation has already been correctly updated to reflect that the toggle default is effectively False.

Original context: e7e1a40#commitcomment-179325396

I discovered this while working on larger refactoring of the FEATURES dictionary: #38095

This line was likely added here with the intent of defining an
edx-toggles-style FeatureToggle object. Instead, it just
declares a local variable named ENABLE_FORUM_DAILY_DIGEST,
whereas the actual check occurs at either of:

* settings.ENABLE_FORUM_DAILY_DIGEST  # new way
* settings.FEATURES['ENABLE_FORUM_DAILY_DIGEST']  # old way

The toggle annotation has already been correctly updated
to reflect that the toggle default is effectively False.
@kdmccormick kdmccormick marked this pull request as ready for review March 30, 2026 17:27
@kdmccormick kdmccormick requested a review from robrap March 30, 2026 17:27
kdmccormick referenced this pull request Mar 30, 2026
The ENABLE_FORUM_DAILY_DIGEST config was using both
a Django Setting and a waffle flag. This consolidates
this to simply use the single Django Setting:
FEATURES['ENABLE_FORUM_DAILY_DIGEST'].

ARCHBOM-132

def is_forum_daily_digest_enabled():
"""Returns whether forum notification features should be visible"""
return settings.FEATURES.get('ENABLE_FORUM_DAILY_DIGEST', False)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be best to just move the toggle annotations above this line, inside the method. Thoughts?

Copy link
Copy Markdown
Contributor

@robrap robrap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants