From 69ec9a2599a0c9ab14d35806c7a9b83fe1994e59 Mon Sep 17 00:00:00 2001 From: Matthew Piatetsky Date: Fri, 26 Feb 2021 15:12:49 -0500 Subject: [PATCH] Check course home toggle in addition to courseware toggle --- common/djangoapps/student/models.py | 7 +++---- lms/djangoapps/courseware/toggles.py | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index d4d4012e0a..7594792153 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -76,7 +76,7 @@ from lms.djangoapps.courseware.models import ( OrgDynamicUpgradeDeadlineConfiguration, ) from lms.djangoapps.courseware.toggles import ( - courseware_mfe_streak_celebration_is_active, + streak_celebration_is_active, COURSEWARE_PROCTORING_IMPROVEMENTS, ) from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification @@ -3210,9 +3210,8 @@ class UserCelebration(TimeStampedModel): def _get_celebration(cls, user, course_key): """ Retrieve (or create) the celebration for the provided user and course_key """ try: - # The UI for celebrations is only supported on the MFE right now, so don't turn on - # celebrations unless this enrollment's course is MFE-enabled and has milestones enabled. - if not courseware_mfe_streak_celebration_is_active(course_key): + # Only enable the streak if milestones and the streak are enabled for this course + if not streak_celebration_is_active(course_key): return None return user.celebration except (cls.DoesNotExist, User.celebration.RelatedObjectDoesNotExist): # pylint: disable=no-member diff --git a/lms/djangoapps/courseware/toggles.py b/lms/djangoapps/courseware/toggles.py index aed8dc0d5a..f1f4924798 100644 --- a/lms/djangoapps/courseware/toggles.py +++ b/lms/djangoapps/courseware/toggles.py @@ -162,9 +162,8 @@ def courseware_mfe_first_section_celebration_is_active(course_key): ) -def courseware_mfe_streak_celebration_is_active(course_key): +def streak_celebration_is_active(course_key): return ( - REDIRECT_TO_COURSEWARE_MICROFRONTEND.is_enabled(course_key) and COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES.is_enabled(course_key) and COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES_STREAK_CELEBRATION.is_enabled(course_key) )