diff options
author | Alban Gruin | 2017-01-22 14:34:14 +0100 |
---|---|---|
committer | Alban Gruin | 2017-01-22 14:34:14 +0100 |
commit | c35a975116bd1a478b7d09028ffba662796d8890 (patch) | |
tree | d232632a2dd3f276a7913768d8430a017c8a2fa3 /management/commands/timetables.py | |
parent | 310c91fcd777a9e7c97379803e41d795a4661be7 (diff) |
Affichage de la dernière mise à jour sur les pages concernées
Diffstat (limited to 'management/commands/timetables.py')
-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) |