aboutsummaryrefslogtreecommitdiffstats
path: root/src/booking/stats.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/booking/stats.py')
-rw-r--r--src/booking/stats.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/booking/stats.py b/src/booking/stats.py
index 62ba648..383723a 100644
--- a/src/booking/stats.py
+++ b/src/booking/stats.py
@@ -32,7 +32,7 @@ class StatisticsManager(object):
now = datetime.datetime.now(pytz.utc)
delta = datetime.timedelta(days=span)
end = now - delta
- bookings = Booking.objects.filter(start__lte=now, end__gte=end)
+ bookings = Booking.objects.filter(start__lte=now, end__gte=end).prefetch_related("collaborators")
for booking in bookings: # collect data from each booking
user_list = [u.pk for u in booking.collaborators.all()]
user_list.append(booking.owner.pk)