Skip to content

Commit

Permalink
Merge pull request #1102 from opengisch/QF-5031-fix-missing-tz
Browse files Browse the repository at this point in the history
Fix missing timezones
  • Loading branch information
suricactus authored Jan 8, 2025
2 parents e62ed6c + 06ddccc commit 3c9290a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit 3c9290a

Please sign in to comment.