Commit 0faa6837 by Calen Pennington

Update access to deprecated enrollment.course (which now doesn't create the…

Update access to deprecated enrollment.course (which now doesn't create the CourseOverview transparently)
parent 84075efc
......@@ -1009,7 +1009,6 @@ class CourseEnrollment(models.Model):
else:
self._course_id = value
created = models.DateTimeField(auto_now_add=True, null=True, db_index=True)
# If is_active is False, then the student is not considered to be enrolled
......@@ -1678,7 +1677,7 @@ class CourseEnrollment(models.Model):
If the course is re-published within the lifetime of this
CourseEnrollment object, then the value of this property will
become stale.
"""
"""
if not self._course_overview:
try:
self._course_overview = CourseOverview.get_from_id(self.course_id)
......
......@@ -88,11 +88,11 @@ def _listen_for_track_change(sender, user, **kwargs): # pylint: disable=unused-
user_enrollments = CourseEnrollment.enrollments_for_user(user=user)
grade_factory = CourseGradeFactory()
for enrollment in user_enrollments:
if grade_factory.read(user=user, course=enrollment.course).passed:
if fire_ungenerated_certificate_task(user, enrollment.course.id):
if grade_factory.read(user=user, course=enrollment.course_overview).passed:
if fire_ungenerated_certificate_task(user, enrollment.course_id):
log.info(u'Certificate generation task initiated for {user} : {course} via track change'.format(
user=user.id,
course=enrollment.course.id
course=enrollment.course_id
))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment