From 0204bd2444736979ff7159c8a9921e0221128c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 11 Dec 2023 21:25:36 +0100 Subject: [PATCH] =?UTF-8?q?Odstran=C4=9Bn=C3=AD=20pytz=20(pou=C5=BEit=20po?= =?UTF-8?q?uze=20v=20testdatech,=20ale=20tam=20naopak=20budeme=20l=C3=A9pe?= =?UTF-8?q?=20simulovat=20aktu=C3=A1ln=C3=AD=20stav,=20kdy=C5=BE=20tam=20n?= =?UTF-8?q?acpeme=20UTC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 1 - seminar/templatetags/utils.py | 1 - seminar/testutils.py | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index ca6b0a6a..df4ea6ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,6 @@ html5lib ipython Pillow pilkit>=3.0 # Kvůli kompatibilitě s Pillow>=10.0.0 -pytz pexpect traitlets Unidecode diff --git a/seminar/templatetags/utils.py b/seminar/templatetags/utils.py index 4ba33a0e..ca400050 100644 --- a/seminar/templatetags/utils.py +++ b/seminar/templatetags/utils.py @@ -1,7 +1,6 @@ from django import template from django.utils.safestring import mark_safe from datetime import datetime, timedelta -from pytz import timezone from mamweb.settings import TIME_ZONE import logging register = template.Library() diff --git a/seminar/testutils.py b/seminar/testutils.py index 7076d5f0..c3d64f56 100644 --- a/seminar/testutils.py +++ b/seminar/testutils.py @@ -4,7 +4,6 @@ import datetime from django.contrib.auth.models import Permission from django.contrib.auth.models import Group -from pytz import timezone import random import lorem import django.contrib.auth @@ -177,13 +176,13 @@ def gen_organizatori(rnd, osoby, last_rocnik): year=1993 + pusobnost, month=rnd.randint(1, 12), day=rnd.randint(1, 28), - tzinfo=timezone('CET'), + tzinfo=datetime.timezone.utc, ) do = datetime.datetime( year=od.year + rnd.randint(1, 6), month=rnd.randint(1, 12), day=rnd.randint(1, 28), - tzinfo=timezone('CET'), + tzinfo=datetime.timezone.utc, ) #aktualni organizatori jeste nemaji vyplnene organizuje_do