diff options
Diffstat (limited to 'management/commands')
-rw-r--r-- | management/commands/timetables.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/management/commands/timetables.py b/management/commands/timetables.py index 21148c8..809b600 100644 --- a/management/commands/timetables.py +++ b/management/commands/timetables.py @@ -27,11 +27,11 @@ def process_timetable_week(timetable, year, week, soup, weeks_in_soup): date = timezone.make_aware(datetime.datetime.now()) try: - lastUpdate = LastUpdate.objects.get(timetable=timetable, year=year, week=week) - lastUpdate.date = date + last_update = LastUpdate.objects.get(timetable=timetable, year=year, week=week) + last_update.date = date except: - lastUpdate = LastUpdate(timetable=timetable, year=year, week=week, date=date) - lastUpdate.save() + last_update = LastUpdate(timetable=timetable, year=year, week=week, date=date) + last_update.save() def process_timetable(timetable, year, weeks): soup = get_xml(timetable.url) |