diff options
Diffstat (limited to 'management/commands')
-rw-r--r-- | management/commands/timetables.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/management/commands/timetables.py b/management/commands/timetables.py index 45a57ee..0716a91 100644 --- a/management/commands/timetables.py +++ b/management/commands/timetables.py @@ -15,6 +15,7 @@ from django.core.management.base import BaseCommand from django.db import transaction +from django.db.models import Max from django.utils import timezone from edt.models import Timetable, Course @@ -27,9 +28,8 @@ import datetime def process_timetable_week(timetable, year, week, soup, weeks_in_soup): begin, end = get_weeks(year, week) - last_update_date = Course.objects.filter(begin__gte=start, begin__lt=end).aggregate(Max("last_update"))["last_update__max"] + last_update_date = Course.objects.filter(begin__gte=begin, begin__lt=end).aggregate(Max("last_update"))["last_update__max"] new_update_date = get_update_date(soup) - updated_at = timezone.make_aware(datetime.datetime.now()) if last_update_date is not None and new_update_date is not None and \ last_update_date >= new_update_date: @@ -42,7 +42,6 @@ def process_timetable_week(timetable, year, week, soup, weeks_in_soup): course.name = name course.type = type_ course.notes = notes - course.updated_at = updated_at course.groups.add(*groups) if rooms is not None: |