aboutsummaryrefslogtreecommitdiff
path: root/management/commands/timetables.py
diff options
context:
space:
mode:
authorAlban Gruin2017-02-28 13:30:03 +0100
committerAlban Gruin2017-02-28 13:30:03 +0100
commitce0ed9347adde9ca80c11efe79766c966d5749ba (patch)
treee371a2d06374efbad1c1c8a4558d92ee0a07c025 /management/commands/timetables.py
parenta543aaa14957f390d2b640a264113b639c7d3194 (diff)
parent66be6f2e7a3c642fb3c69e7c2a70cc3f898d77ea (diff)
Merge branch 'stable/0.y.z' into prod/pa1ch/0.y.zv0.7.0-pa1ch
Diffstat (limited to 'management/commands/timetables.py')
-rw-r--r--management/commands/timetables.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/management/commands/timetables.py b/management/commands/timetables.py
index 88d9008..d39075d 100644
--- a/management/commands/timetables.py
+++ b/management/commands/timetables.py
@@ -14,22 +14,19 @@
# with celcatsanitizer; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-from django.core.management.base import BaseCommand, CommandError
+from django.core.management.base import BaseCommand
from django.db import transaction
from django.utils import timezone
-from edt.models import Timetable, LastUpdate, Group, Room, Course
+from edt.models import Timetable, LastUpdate, Course
-from bs4 import BeautifulSoup
-
-from ._private import delete_courses_in_week, get_events, get_weeks, get_xml, Week
+from ._private import delete_courses_in_week, get_events, get_weeks, get_xml
import datetime
-import requests
@transaction.atomic
def process_timetable_week(timetable, year, week, soup, weeks_in_soup):
delete_courses_in_week(timetable, year, week)
- for name, type_, groups, rooms, notes, begin, end in get_events(soup, weeks_in_soup, year, week, timetable):
+ for name, type_, groups, rooms, notes, begin, end in get_events(timetable, year, week, soup, weeks_in_soup):
course = Course.objects.create(timetable=timetable, begin=begin, end=end)
course.name = name
course.type = type_