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): ...@@ -1009,7 +1009,6 @@ class CourseEnrollment(models.Model):
else: else:
self._course_id = value self._course_id = value
created = models.DateTimeField(auto_now_add=True, null=True, db_index=True) 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 # If is_active is False, then the student is not considered to be enrolled
......
...@@ -88,11 +88,11 @@ def _listen_for_track_change(sender, user, **kwargs): # pylint: disable=unused- ...@@ -88,11 +88,11 @@ def _listen_for_track_change(sender, user, **kwargs): # pylint: disable=unused-
user_enrollments = CourseEnrollment.enrollments_for_user(user=user) user_enrollments = CourseEnrollment.enrollments_for_user(user=user)
grade_factory = CourseGradeFactory() grade_factory = CourseGradeFactory()
for enrollment in user_enrollments: for enrollment in user_enrollments:
if grade_factory.read(user=user, course=enrollment.course).passed: if grade_factory.read(user=user, course=enrollment.course_overview).passed:
if fire_ungenerated_certificate_task(user, enrollment.course.id): if fire_ungenerated_certificate_task(user, enrollment.course_id):
log.info(u'Certificate generation task initiated for {user} : {course} via track change'.format( log.info(u'Certificate generation task initiated for {user} : {course} via track change'.format(
user=user.id, 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