Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added waffle flag for new notification view #35569

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ayesha-waris
Copy link
Contributor

INF-1603
The ticket require new notifications view to be used by flag notifications.enable_new_notification_view

Comment on lines +51 to +61
def get_is_new_notification_view_enabled():
"""
Returns True if the waffle flag for the new notification view is enabled, False otherwise.
"""
flag_model = get_waffle_flag_model()

try:
flag = flag_model.objects.get(name=ENABLE_NEW_NOTIFICATION_VIEW.name)
return flag.everyone if flag.everyone is not None else False
except flag_model.DoesNotExist:
return False
Copy link
Contributor

Choose a reason for hiding this comment

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

To check if WaffleFlag is enabled, use .is_enabled() because no course or user information is required. Custom implementation will be helpful when waffle flag needs to be enabled for a specific user/s.

def get_is_new_notification_view_enabled():
    """
    Returns True if the waffle flag for the new notification view is enabled, False otherwise.
    """
    return ENABLE_NEW_NOTIFICATION_VIEW.is_enabled()

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.

4 participants