Got the template that is used with tests but not this one.

This dashboard template is only used for edx.org so we didn't catch this
in testing.  Updating it to use 'course' instead of 'course_id' to
instantiate a CourseEnrollment object.  Using 'course_id' is the old
way.
This commit is contained in:
Feanil Patel
2020-04-06 14:25:58 -04:00
parent 6b276e6742
commit f61b2e44eb

View File

@@ -185,7 +185,7 @@ from student.models import CourseEnrollment
pseudo_session = unfulfilled_entitlement_pseudo_sessions[str(entitlement.uuid)]
if not pseudo_session:
continue
enrollment = CourseEnrollment(user=user, course_id=pseudo_session['key'], mode=pseudo_session['type'])
enrollment = CourseEnrollment(user=user, course=CourseOverview.get_from_id(pseudo_session['key']), mode=pseudo_session['type'])
# We only show email settings for entitlement cards if the entitlement has an associated enrollment
show_email_settings = is_fulfilled_entitlement and (entitlement_session.course_id in show_email_settings_for)
else: