Don't assume due dates on sections

The content highlights code assumed due dates existed on all
sections. But we recently broke that assumption. So now we
recalculate the spread of sections across the expected duration
ourselves rather than rely on due dates.
This commit is contained in:
Michael Terry
2020-05-12 15:13:32 -04:00
parent 4bdb8c56b5
commit 3f2b2da22b
6 changed files with 54 additions and 31 deletions

View File

@@ -67,6 +67,10 @@ def get_user_course_duration(user, course):
if enrollment is None or enrollment.mode != CourseMode.AUDIT:
return None
verified_mode = CourseMode.verified_mode_for_course(course=course, include_expired=True)
if not verified_mode:
return None
return get_expected_duration(course)