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

@@ -107,7 +107,7 @@ class FinancialAssistanceTool(CourseTool):
return False
# hide link for archived courses
if course_overview is not None and course_overview.end_date is not None and now > course_overview.end_date:
if course_overview is not None and course_overview.end is not None and now > course_overview.end:
return False
# hide link if not logged in or user not enrolled in the course

View File

@@ -179,7 +179,7 @@ class FinancialAssistanceToolTest(SharedModuleStoreTestCase):
assert not FinancialAssistanceTool().is_enabled(self.request, self.course.id)
def test_tool_not_visible_when_end_date_passed(self):
self.course_overview.end_date = self.now - datetime.timedelta(days=30)
self.course_overview.end = self.now - datetime.timedelta(days=30)
self.course_overview.save()
assert not FinancialAssistanceTool().is_enabled(self.request, self.course_overview.id)