Skip to content

Commit

Permalink
fix: add a general solution instead of particular for prerequisites c…
Browse files Browse the repository at this point in the history
…ustom functionality
  • Loading branch information
anfbermudezme committed Dec 2, 2021
1 parent fd1cb3d commit 06d1b0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/djangoapps/student/views/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,17 +804,22 @@ def student_dashboard(request):
if enrollment.course_overview.pre_requisite_courses
)
courses_requirements_not_met = get_pre_requisite_courses_not_completed(user, courses_having_prerequisites)
sku_not_enrollment_in_requirement = None

run_extension_point(
'PEARSON_CORE_SORT_ENROLLED_PREREQUISITES',
user=user,
courses_requirements_not_met=courses_requirements_not_met,
)

sku_not_enrollment_in_requirement = run_extension_point(
'PEARSON_CORE_STUDENT_NOT_ENROLLED_IN_REQUIREMENTS',
user = user,
courses_requirements_not_met=courses_requirements_not_met,
)

if not sku_not_enrollment_in_requirement:
sku_not_enrollment_in_requirement = {}

if 'notlive' in request.GET:
redirect_message = _("The course you are looking for does not start until {date}.").format(
date=request.GET['notlive']
Expand Down
3 changes: 3 additions & 0 deletions lms/djangoapps/courseware/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,9 @@ def course_about(request, course_id):
courses_requirements_not_met=courses_requirements_not_met,
)

sku_not_enrollment_in_requirement = \
sku_not_enrollment_in_requirement[course.id] if sku_not_enrollment_in_requirement else None

# Overview
overview = CourseOverview.get_from_id(course.id)

Expand Down

0 comments on commit 06d1b0f

Please sign in to comment.