more tz aware now

This commit is contained in:
j 2023-08-14 23:33:23 +02:00
parent c192f91a03
commit fccc67fba9

View file

@ -24,8 +24,9 @@ def index(request):
now = request.GET.get("now") now = request.GET.get("now")
if request.user.is_staff and now: if request.user.is_staff and now:
now = datetime.strptime(now, TS_FORMAT) now = datetime.strptime(now, TS_FORMAT)
now = timezone.make_aware(now, timezone.get_default_timezone())
elif request.user.is_staff: elif request.user.is_staff:
now = timezone.now() now = timezone.make_aware(datetime.now(), timezone.get_default_timezone())
else: else:
now = None now = None
week, archive = models.Item.public(now) week, archive = models.Item.public(now)