summaryrefslogtreecommitdiffstats
path: root/dashboard
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-06-24 18:02:21 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-06-24 18:02:21 +0000
commit6120aa3d50e645d536a27abd4da1f69c204d7e7a (patch)
treeb45a45839a28ef90e226ea61d42c5c5380fb6802 /dashboard
parent269041890fb9329648d9243e2ab88bd6a5d40fb0 (diff)
parent7a8eb69cae1e1b35b8ca3630c665678e2cae117e (diff)
Merge "Prefetches Collaborators"
Diffstat (limited to 'dashboard')
-rw-r--r--dashboard/src/booking/stats.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/dashboard/src/booking/stats.py b/dashboard/src/booking/stats.py
index 62ba648..383723a 100644
--- a/dashboard/src/booking/stats.py
+++ b/dashboard/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)