refactor: Switch to using course_overview start and end everywhere

In DE-1822, we believed we needed to switch to start_date and end_date.
It was determined this was not the case, so this updates the comment
to ensure future users use the correct fields (start and end) and
updates any pieces of code that may have used start_date or end_date.
This commit is contained in:
Dillon Dumesnil
2021-05-06 16:42:10 -04:00
parent 599d21b7bb
commit 89c463ff29
6 changed files with 12 additions and 15 deletions

View File

@@ -76,12 +76,11 @@ def has_certificates_enabled(course):
def should_display_grade(course_overview):
"""
Returns True or False depending upon either certificate available date
or course-end-date
or course end date
"""
course_end_date = course_overview.end_date
cert_available_date = course_overview.certificate_available_date
current_date = now().replace(hour=0, minute=0, second=0, microsecond=0)
if cert_available_date:
return cert_available_date < current_date
return course_end_date and course_end_date < current_date
return course_overview.end and course_overview.end < current_date