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

@@ -172,11 +172,9 @@ def dates_banner_should_display(course_key, user):
return False, False
course_overview = CourseOverview.objects.get(id=str(course_key))
course_end_date = getattr(course_overview, 'end_date', None)
is_self_paced = getattr(course_overview, 'self_paced', False)
# Only display the banner for self-paced courses
if not is_self_paced:
if not course_overview.self_paced:
return False, False
# Only display the banner for enrolled users
@@ -184,7 +182,7 @@ def dates_banner_should_display(course_key, user):
return False, False
# Don't display the banner if the course has ended
if course_end_date and course_end_date < timezone.now():
if course_overview.end and course_overview.end < timezone.now():
return False, False
store = modulestore()