Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing timezones #1102

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docker-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ RUN apt-get update && apt-get install -y \
# needed for Django's `manage.py makemessages`
gettext \
# for development purposes only (optional dependency for `django-extensions`)
graphviz
graphviz \
# timezone data used by python to determine the user's timezone
tzdata

# copy the dependencies
COPY --from=build /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/
Expand Down
4 changes: 2 additions & 2 deletions docker-app/qfieldcloud/core/middleware/timezone.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytz
import zoneinfo
from django.conf import settings
from django.utils import timezone

Expand All @@ -13,7 +13,7 @@ def __call__(self, request):
):
user_tz = request.user.useraccount.timezone
elif settings.TIME_ZONE:
user_tz = pytz.timezone(settings.TIME_ZONE)
user_tz = zoneinfo.ZoneInfo(settings.TIME_ZONE)
else:
user_tz = None

Expand Down
Loading