]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
REST: Prefetch Series.project
authorStephen Finucane <stephen@that.guru>
Tue, 21 Feb 2017 16:21:11 +0000 (11:21 -0500)
committerStephen Finucane <stephen@that.guru>
Mon, 20 Mar 2017 18:23:25 +0000 (18:23 +0000)
I missed this when testing due to only having a single project. There
will be performance issues on instances using multiple projects.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
patchwork/api/series.py

index f66f0d2be7066514bc836d02c81833fb01eb7eff..3d5847bef572eac6643f9b28dd6300ffa0a37133 100644 (file)
@@ -51,7 +51,7 @@ class SeriesMixin(object):
 
     def get_queryset(self):
         return Series.objects.all().prefetch_related('patches',)\
-            .select_related('submitter', 'cover_letter')
+            .select_related('submitter', 'cover_letter', 'project')
 
 
 class SeriesList(SeriesMixin, ListAPIView):