aboutsummaryrefslogtreecommitdiff
path: root/management/commands
diff options
context:
space:
mode:
Diffstat (limited to 'management/commands')
-rw-r--r--management/commands/timetables.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/management/commands/timetables.py b/management/commands/timetables.py
index efdd611..e136f53 100644
--- a/management/commands/timetables.py
+++ b/management/commands/timetables.py
@@ -19,15 +19,16 @@ from django.db.models import Max
from django.utils import timezone
from edt.models import Timetable, Course
+from edt.utils import get_week
from ._private import delete_courses_in_week, get_events, get_update_date, get_weeks, get_xml
import datetime
@transaction.atomic
def process_timetable_week(timetable, year, week, soup, weeks_in_soup):
- begin, end = get_weeks(year, week)
+ begin, end = get_week(year, week)
- last_update_date = Course.objects.filter(begin__gte=begin, begin__lt=end).aggregate(Max("last_update"))["last_update__max"]
+ last_update_date = Course.objects.filter(timetable=timetable, begin__gte=begin, begin__lt=end).aggregate(Max("last_update"))["last_update__max"]
new_update_date = get_update_date(soup)
if last_update_date is not None and new_update_date is not None and \