Use cached data to find completed programs on LMS

These changes improve the performance of the LMS' program certification task. They also reduce strain on the programs service, especially when attempting to award program certificates to large numbers of students. ECOM-4490.
This commit is contained in:
Renzo Lucioni
2016-06-08 13:51:53 -04:00
parent 6bd35fd6c6
commit 6d7938fde0
6 changed files with 203 additions and 169 deletions

View File

@@ -56,8 +56,6 @@ class TestProgramListing(
def _create_course_and_enroll(self, student, org, course, run):
"""
Creates a course and associated enrollment.
TODO: Use CourseEnrollmentFactory to avoid course creation.
"""
course_location = locator.CourseLocator(org, course, run)
course = CourseFactory.create(

View File

@@ -11,7 +11,6 @@ from edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.credentials.utils import get_programs_credentials
from openedx.core.djangoapps.programs.models import ProgramsApiConfig
from openedx.core.djangoapps.programs import utils
from student.views import get_course_enrollments
@login_required
@@ -22,8 +21,7 @@ def view_programs(request):
if not show_program_listing:
raise Http404
enrollments = list(get_course_enrollments(request.user, None, []))
meter = utils.ProgramProgressMeter(request.user, enrollments)
meter = utils.ProgramProgressMeter(request.user)
programs = meter.engaged_programs
# TODO: Pull 'xseries' string from configuration model.