Fix naive date

This commit is contained in:
Lukáš Kucharczyk 2023-11-16 16:24:07 +01:00
parent c49177d63c
commit f2bb15e669
1 changed files with 1 additions and 1 deletions

View File

@ -274,7 +274,7 @@ def list_sessions(
context["ownership_type"] = dict(Purchase.OWNERSHIP_TYPES)[ownership_type] context["ownership_type"] = dict(Purchase.OWNERSHIP_TYPES)[ownership_type]
elif filter == "recent": elif filter == "recent":
current_year = timezone.now().year current_year = timezone.now().year
first_day_of_year = datetime(current_year, 1, 1) first_day_of_year = timezone.make_aware(datetime(current_year, 1, 1))
dataset = Session.objects.filter( dataset = Session.objects.filter(
timestamp_start__gte=first_day_of_year timestamp_start__gte=first_day_of_year
).order_by("-timestamp_start") ).order_by("-timestamp_start")