aboutsummaryrefslogtreecommitdiff
path: root/management
diff options
context:
space:
mode:
Diffstat (limited to 'management')
-rw-r--r--management/commands/timetables.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/management/commands/timetables.py b/management/commands/timetables.py
index a152f9e..35fb26e 100644
--- a/management/commands/timetables.py
+++ b/management/commands/timetables.py
@@ -21,7 +21,7 @@ from django.db.models import Min
from django.utils import timezone
from edt.models import Course, Timetable
-from edt.utils import get_week
+from edt.utils import get_week, tz_now
from ._private import delete_courses_in_week, get_events, get_update_date, get_weeks, get_xml
@transaction.atomic
@@ -32,7 +32,7 @@ def process_timetable_week(timetable, soup, weeks_in_soup, force, year=None, wee
if force:
today = begin
else:
- today = timezone.make_aware(datetime.datetime.now())
+ today = tz_now()
# On récupère la mise à jour la plus ancienne dans les cours de l’emploi du temps
# commençant à partir de maintenant
@@ -107,16 +107,16 @@ class Command(BaseCommand):
if options["all"]:
weeks = None
elif options["week"] is None:
- _, week, day = timezone.now().isocalendar()
+ _, week, day = tz_now().isocalendar()
if day >= 6:
- year, week, _ = (timezone.now() + datetime.timedelta(weeks=1)).isocalendar()
+ year, week, _ = (tz_now() + datetime.timedelta(weeks=1)).isocalendar()
weeks = [week]
else:
weeks = options["week"]
if not options["all"]:
if options["year"] is None and year is None:
- year = timezone.now().year
+ year = tz_now().year
elif year is None:
year = options["year"][0]