feat: Add 2U recommendations in dashboard [VAN-1094] (#31026)
This commit is contained in:
committed by
GitHub
parent
62fd296b7c
commit
96f6174d9e
@@ -23,6 +23,23 @@ def should_show_amplitude_recommendations():
|
||||
return ENABLE_AMPLITUDE_RECOMMENDATIONS.is_enabled()
|
||||
|
||||
|
||||
# Waffle flag to enable 2U Recommendations
|
||||
# .. toggle_name: student.enable_2u_recommendations
|
||||
# .. toggle_implementation: WaffleFlag
|
||||
# .. toggle_default: False
|
||||
# .. toggle_description: Supports rollout of a POC for 2U recommendations.
|
||||
# .. toggle_use_cases: temporary
|
||||
# .. toggle_creation_date: 2022-09-20
|
||||
# .. toggle_target_removal_date: None
|
||||
# .. toggle_warning: None
|
||||
# .. toggle_tickets: VAN-1094
|
||||
ENABLE_2U_RECOMMENDATIONS_ON_DASHBOARD = WaffleFlag(f'{WAFFLE_FLAG_NAMESPACE}.enable_2u_recommendations', __name__)
|
||||
|
||||
|
||||
def should_show_2u_recommendations():
|
||||
return ENABLE_2U_RECOMMENDATIONS_ON_DASHBOARD.is_enabled()
|
||||
|
||||
|
||||
# Waffle flag to enable redesigned course enrollment confirmation email.
|
||||
# .. toggle_name: student.enable_redesign_enrollment_confirmation_email
|
||||
# .. toggle_implementation: WaffleFlag
|
||||
|
||||
@@ -18,6 +18,7 @@ from django.views.decorators.csrf import ensure_csrf_cookie
|
||||
from edx_django_utils import monitoring as monitoring_utils
|
||||
from edx_django_utils.plugins import get_plugins_view_context
|
||||
from edx_toggles.toggles import WaffleFlag
|
||||
from ipware.ip import get_client_ip
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from openedx_filters.learning.filters import DashboardRenderStarted
|
||||
from pytz import UTC
|
||||
@@ -50,6 +51,7 @@ from openedx.features.enterprise_support.api import (
|
||||
get_dashboard_consent_notification,
|
||||
get_enterprise_learner_portal_context,
|
||||
)
|
||||
from openedx.core.djangoapps.geoinfo.api import country_code_from_ip
|
||||
from common.djangoapps.student.api import COURSE_DASHBOARD_PLUGIN_VIEW_NAME
|
||||
from common.djangoapps.student.helpers import cert_info, check_verify_status_by_course, get_resume_urls_for_enrollments
|
||||
from common.djangoapps.student.models import (
|
||||
@@ -778,6 +780,9 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
|
||||
if fbe_is_on:
|
||||
enrollments_fbe_is_on.append(course_key)
|
||||
|
||||
ip_address = get_client_ip(request)[0]
|
||||
country_code = country_code_from_ip(ip_address).upper()
|
||||
|
||||
context = {
|
||||
'urls': urls,
|
||||
'programs_data': programs_data,
|
||||
@@ -832,6 +837,7 @@ def student_dashboard(request): # lint-amnesty, pylint: disable=too-many-statem
|
||||
'course_info': get_dashboard_course_info(user, course_enrollments),
|
||||
# TODO START: clean up as part of REVEM-199 (END)
|
||||
'disable_unenrollment': disable_unenrollment,
|
||||
'country_code': country_code,
|
||||
}
|
||||
|
||||
# Include enterprise learner portal metadata and messaging
|
||||
|
||||
Reference in New Issue
Block a user