fix: Use dashboard_index to get FBE status (#30463)

REV-2466
This commit is contained in:
julianajlk
2022-05-24 10:24:38 -04:00
committed by GitHub
parent 23aa0d39c1
commit e25e17ee88
3 changed files with 27 additions and 27 deletions

View File

@@ -764,7 +764,7 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
show_account_activation_popup = request.COOKIES.get(settings.SHOW_ACTIVATE_CTA_POPUP_COOKIE_NAME, None)
fbe_status_list = []
enrollments_fbe_is_on = []
for enrollment in course_enrollments:
course_key = CourseKey.from_string(str(enrollment.course_id))
gated_content = ContentTypeGatingConfig.enabled_for_enrollment(
@@ -774,7 +774,7 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
duration = get_user_course_duration(enrollment.user, enrollment.course)
deadline = duration and get_user_course_expiration_date(request.user, enrollment.course)
fbe_is_on = bool(deadline and gated_content)
fbe_status_list.append(fbe_is_on)
enrollments_fbe_is_on.append(fbe_is_on)
context = {
'urls': urls,
@@ -822,7 +822,7 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
'display_sidebar_account_activation_message': not(user.is_active or hide_dashboard_courses_until_activated),
'display_dashboard_courses': (user.is_active or not hide_dashboard_courses_until_activated),
'empty_dashboard_message': empty_dashboard_message,
'fbe_status_list': fbe_status_list,
'enrollments_fbe_is_on': enrollments_fbe_is_on,
'recovery_email_message': recovery_email_message,
'recovery_email_activation_message': recovery_email_activation_message,
'show_load_all_courses_link': show_load_all_courses_link(user, course_limit, course_enrollments),