Skip to content
Snippets Groups Projects
Commit 7691d54f authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Make remaining datetime objects timezone aware

parent 99b0f84f
No related branches found
No related tags found
No related merge requests found
......@@ -824,7 +824,7 @@ class TimeSlotManager(models.Manager):
@staticmethod
def get_24h_timeslots(start):
end = start + timedelta(hours=24)
end = timezone.make_aware(start + timedelta(hours=24))
return TimeSlot.objects.filter(Q(start__lte=start, end__gte=start) |
Q(start__gt=start, start__lt=end)).exclude(end=start)
......@@ -832,7 +832,7 @@ class TimeSlotManager(models.Manager):
@staticmethod
def get_7d_timeslots(start):
start = datetime.combine(start, time(0, 0))
end = start + timedelta(days=7)
end = timezone.make_aware(start + timedelta(days=7))
return TimeSlot.objects.filter(Q(start__lte=start, end__gte=start) |
Q(start__gt=start, start__lt=end)).exclude(end=start)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment