If patches have a delegate, the patch list template will cause a query
to render the delegate username. Instead, we should include the delegate
in the select_related query.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
# but we will need to follow the state and submitter relations for
# rendering the list template
- patches = patches.select_related('state', 'submitter')
+ patches = patches.select_related('state', 'submitter', 'delegate')
paginator = Paginator(request, patches)