From 7124d6778d170bf9d5d9372e00e52e51cac82652 Mon Sep 17 00:00:00 2001 From: Maria Grimaldi Date: Tue, 25 Jan 2022 17:15:42 -0400 Subject: [PATCH] fix: avoid TypeError when comparing course.end with current date --- lms/djangoapps/courseware/date_summary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/djangoapps/courseware/date_summary.py b/lms/djangoapps/courseware/date_summary.py index f90fa17dcc..ce8d8e3a2d 100644 --- a/lms/djangoapps/courseware/date_summary.py +++ b/lms/djangoapps/courseware/date_summary.py @@ -518,7 +518,7 @@ class CertificateAvailableDate(DateSummary): Registers an alert close to the certificate delivery date. """ is_enrolled = CourseEnrollment.get_enrollment(request.user, course.id) - if not is_enrolled or not self.is_enabled or course.end > self.current_time: + if not is_enrolled or not self.is_enabled or (course.end and course.end > self.current_time): return if self.date > self.current_time: CourseHomeMessages.register_info_message(