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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user