Commit 697be6a5 authored by Martin Peres's avatar Martin Peres

views/open_bugs: reduce the amount of DB queries

This reduces quite a bit the amount of queries, which should reduce
the IOPS for the database.
parent 4981ac03
Pipeline #69036 passed with stages
in 6 minutes and 16 seconds
......@@ -56,7 +56,8 @@ def open_bugs(request, **kwargs):
'bugs_assigned', 'bugs_still_open',
'bugs_closed', 'all_comments'))
devs = dict()
for dev in sorted(BugTrackerAccount.objects.filter(is_developer=True), key=lambda a: str(a)):
for dev in sorted(BugTrackerAccount.objects.filter(is_developer=True).select_related('person'),
key=lambda a: str(a)):
devs[dev] = DeveloperStatistics(bugs_created=set(), bugs_assigned=set(), bugs_involved=set(),
bugs_still_open=set(), bugs_closed=set(), all_comments=set())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment