Skip to content

Commit

Permalink
refactor: add entry for run_extension_point in course_about view and …
Browse files Browse the repository at this point in the history
…remove magic number un course.py.
  • Loading branch information
anfbermudezme committed Feb 1, 2022
1 parent 878a61a commit f8f73be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,10 +1161,11 @@ def settings_handler(request, course_key_string):
if not all(is_valid_course_key(course_key) for course_key in prerequisite_course_keys):
return JsonResponseBadRequest({"error": _("Invalid prerequisite course key")})
set_prerequisite_courses(course_key, prerequisite_course_keys)
PREREQUISITE_NOT_MET = 0
run_extension_point(
'PEARSON_CORE_MILESTONE_PREREQUISITES_MODULE',
course_key=course_key,
prerequisite_course_key=CourseKey.from_string(prerequisite_course_keys[0])
prerequisite_course_key=CourseKey.from_string(prerequisite_course_keys[PREREQUISITE_NOT_MET]),
)
else:
# None is chosen, so remove the course prerequisites
Expand Down
1 change: 1 addition & 0 deletions lms/djangoapps/courseware/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ def course_about(request, course_id):
course_requirements = run_extension_point(
'PEARSON_CORE_STUDENT_COURSE_REQUIREMENTS_FOR_COURSEWARE',
courses_requirements_not_met=courses_requirements_not_met,
course_locator=course.id,
)

# Overview
Expand Down

0 comments on commit f8f73be

Please sign in to comment.