diff options
Diffstat (limited to 'management/parsers/ups2017.py')
-rw-r--r-- | management/parsers/ups2017.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/management/parsers/ups2017.py b/management/parsers/ups2017.py index 94c1918..8522793 100644 --- a/management/parsers/ups2017.py +++ b/management/parsers/ups2017.py @@ -20,7 +20,6 @@ from bs4 import BeautifulSoup from django.utils import timezone from ...models import Course, Group, Room -from ...utils import get_week import requests import edt @@ -32,12 +31,6 @@ def add_time(date, time): return date + delta -def delete_courses_in_week(source, year, week, today): - start, end = get_week(year, week) - Course.objects.filter(begin__gte=max(start, today), begin__lt=end, - source=source).delete() - - def get_event(source, event, event_week, today): """Renvoie une classe Course à partir d’un événement récupéré par BS4""" # On récupère la date de l’évènement à partir de la semaine @@ -155,7 +148,7 @@ def get_weeks(soup): return weeks -def get_xml(url): +def get_source(url): user_agent = "celcatsanitizer/" + edt.VERSION req = requests.get(url, headers={"User-Agent": user_agent}) req.encoding = "utf8" |