diff --git a/AKModel/availability/forms.py b/AKModel/availability/forms.py index 17594263a9066fb30868867f69dc200565397ec5..27d3887a3f96d6a7de5c85fb1e76e05f45e23cef 100644 --- a/AKModel/availability/forms.py +++ b/AKModel/availability/forms.py @@ -80,7 +80,7 @@ class AvailabilitiesFormMixin(forms.Form): if not obj: raise TypeError if obj.tzinfo is None: - obj = tz.localize(obj) + obj = obj.astimezone(tz) return obj diff --git a/AKModel/forms.py b/AKModel/forms.py index aaa621646eac8d9981086e67bd9bd7d996e269d9..bfa327e8835cb0f8b32eb32575a60c0409b505a6 100644 --- a/AKModel/forms.py +++ b/AKModel/forms.py @@ -1,7 +1,7 @@ import csv import io -from bootstrap_datepicker_plus import DateTimePickerInput +from bootstrap_datepicker_plus.widgets import DateTimePickerInput from django import forms from django.forms.utils import ErrorList from django.utils.translation import gettext_lazy as _ diff --git a/AKModel/migrations/0057_upgrades.py b/AKModel/migrations/0057_upgrades.py new file mode 100644 index 0000000000000000000000000000000000000000..8dc09d54078c32e19b3195a96593f893167bba02 --- /dev/null +++ b/AKModel/migrations/0057_upgrades.py @@ -0,0 +1,19 @@ +# Generated by Django 4.1.5 on 2023-01-03 17:04 + +from django.db import migrations +import timezone_field.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('AKModel', '0056_remove_tags'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='timezone', + field=timezone_field.fields.TimeZoneField(choices_display='WITH_GMT_OFFSET', default='Europe/Berlin', help_text='Time Zone where this event takes place in', verbose_name='Time Zone'), + ), + ] diff --git a/AKModel/models.py b/AKModel/models.py index 710b0251bcd4c01e291b8f1d183fec3e780d45ac..5cf5fac7331741b180a4bb0d784d9f6a04f4dc02 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -22,7 +22,7 @@ class Event(models.Model): place = models.CharField(max_length=128, blank=True, verbose_name=_('Place'), help_text=_('City etc. the event takes place in')) - timezone = TimeZoneField(default='Europe/Berlin', display_GMT_offset=True, blank=False, + timezone = TimeZoneField(default='Europe/Berlin', blank=False, choices_display="WITH_GMT_OFFSET", verbose_name=_('Time Zone'), help_text=_('Time Zone where this event takes place in')) start = models.DateTimeField(verbose_name=_('Start'), help_text=_('Time the event begins')) end = models.DateTimeField(verbose_name=_('End'), help_text=_('Time the event ends')) diff --git a/AKModel/views.py b/AKModel/views.py index db61f2fc629c56c6e2842c609bef43098f3ab6a1..68da9f431e43e61fdd48df32f311e7420ea669c4 100644 --- a/AKModel/views.py +++ b/AKModel/views.py @@ -541,8 +541,8 @@ class DefaultSlotEditorView(EventSlugMixin, IntermediateAdminView): previous_slot_ids = set(s.id for s in self.event.defaultslot_set.all()) for slot in default_slots_raw: - start = tz.localize(parse_datetime(slot["start"])) - end = tz.localize(parse_datetime(slot["end"])) + start = parse_datetime(slot["start"]).astimezone(tz) + end = parse_datetime(slot["end"]).astimezone(tz) if slot["id"] != '': id = int(slot["id"]) diff --git a/INSTALL.md b/INSTALL.md index f242088a0f8ae324465347de2848f236d4902b3c..c887af92dba1d2661b5b53ef9a17041d2c1a730d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -10,7 +10,7 @@ setup. ### System Requirements -* Python 3.7 incl. development tools +* Python 3.8+ incl. development tools * Virtualenv * pdflatex & beamer class (`texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-extra texlive-luatex`) diff --git a/requirements.txt b/requirements.txt index 66d2db7a61a276a1d64386099525b9c97a712a86..edd6ea90d5ebe899d60e19400861ced434ffffb5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,15 @@ -Django==3.2.16 +Django==4.1.5 django-bootstrap5==22.2 fontawesomefree==6.2.1 # Makes static files (css, fonts) available locally django-fontawesome-6==1.0.0.0 # Provides an icon field for models and forms as well as handy shortcuts to render icons django-split-settings==1.2.0 -django-timezone-field==4.1.2 +django-timezone-field==5.0 djangorestframework==3.14.0 -django-simple-history==3.1.1 +django-simple-history==3.2.0 django-registration-redux==2.11 -django-debug-toolbar==3.7.0 -django-bootstrap-datepicker-plus==3.0.5 +django-debug-toolbar==3.8.1 +django-bootstrap-datepicker-plus==5.0.2 django-tex==1.1.10 django-csp==3.7 -mysqlclient==2.0.3 # for production deployment -pytz==2022.4 +mysqlclient==2.1.1 # for production deployment +tzdata==2022.7