update schedule start when course start date changes

parent 8b8677a0
......@@ -89,8 +89,6 @@ def update_schedules_on_course_start_changed(sender, updated_course_overview, pr
Updates all course schedules if course hasn't started yet and
the updated start date is still in the future.
"""
current_time = timezone.now()
if previous_start_date > current_time and updated_course_overview.start > current_time:
upgrade_deadline = _calculate_upgrade_deadline(
updated_course_overview.id,
content_availability_date=updated_course_overview.start,
......
......@@ -165,7 +165,7 @@ class UpdateScheduleTests(SharedModuleStoreTestCase):
course.start = course.start + datetime.timedelta(days=3) # new course start changes to another future date
self.store.update_item(course, ModuleStoreEnum.UserID.test)
enrollment = CourseEnrollment.objects.get(id=enrollment.id)
self.assert_schedule_dates(enrollment.schedule, enrollment.created) # start remains unchanged
self.assert_schedule_dates(enrollment.schedule, course.start) # start set to new course start
def test_not_updated_since_new_start_in_past(self, mock_get_current_site):
mock_get_current_site.return_value = self.site
......@@ -178,7 +178,7 @@ class UpdateScheduleTests(SharedModuleStoreTestCase):
course.start = course.start + datetime.timedelta(days=-10) # new course start changes to a past date
self.store.update_item(course, ModuleStoreEnum.UserID.test)
enrollment = CourseEnrollment.objects.get(id=enrollment.id)
self.assert_schedule_dates(enrollment.schedule, previous_start) # start remains unchanged
self.assert_schedule_dates(enrollment.schedule, course.start) # start set to new course start
def _create_course_run(self_paced=True, start_day_offset=-1):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment