From be6f084c336e285652088fe2d86694b2645a0b93 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sat, 30 Sep 2017 16:34:58 +0200 Subject: On ne supprime pas les éléments plus anciens que ceux référencés par Celcat --- management/commands/timetables.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'management') diff --git a/management/commands/timetables.py b/management/commands/timetables.py index 58c86fd..e82fd55 100644 --- a/management/commands/timetables.py +++ b/management/commands/timetables.py @@ -44,7 +44,8 @@ def process_timetable_week(timetable, soup, weeks_in_soup, force, year=None, wee if year is not None and week is not None: delete_courses_in_week(timetable, year, week) else: - Course.objects.filter(timetable=timetable).delete() + Course.objects.filter(timetable=timetable, + begin__gte=min(weeks_in_soup.values())).delete() for course in get_events(timetable, soup, weeks_in_soup, year, week): course.save() -- cgit v1.2.1