Use a standard function to find out if a course has ended

This commit is contained in:
Calen Pennington
2020-06-11 09:11:15 -04:00
parent 1cf46e76d0
commit 86e2677f26
5 changed files with 6 additions and 6 deletions

View File

@@ -794,7 +794,7 @@ class TestProgramDataExtender(ModuleStoreTestCase):
'certificate_url': None,
'course_url': reverse('course_root', args=[self.course.id]),
'enrollment_open_date': strftime_localized(DEFAULT_ENROLLMENT_START_DATE, 'SHORT_DATE'),
'is_course_ended': self.course.end and self.course.end < datetime.datetime.now(utc),
'is_course_ended': self.course.has_ended(),
'is_enrolled': False,
'is_enrollment_open': True,
'upgrade_url': None,

View File

@@ -101,7 +101,7 @@ class CourseOutlineFragmentView(EdxFragmentView):
'on_course_outline_page': True,
'missed_deadlines': missed_deadlines,
'missed_gated_content': missed_gated_content,
'is_archived': course.end and course.end < datetime.now(),
'has_ended': course.has_ended(),
}
html = render_to_string('course_experience/course-outline-fragment.html', context)