Calling prefetch_related on a class-level queryset variable doesn't do anything and is a mistake. Correct this.
Signed-off-by: Stephen Finucane <[email protected]> Cc: Andy Doan <[email protected]> --- patchwork/api/check.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patchwork/api/check.py b/patchwork/api/check.py index dcdc5c5..393fcf2 100644 --- a/patchwork/api/check.py +++ b/patchwork/api/check.py @@ -88,10 +88,12 @@ class CheckSerializer(HyperlinkedModelSerializer): class CheckMixin(object): - queryset = Check.objects.prefetch_related('patch', 'user') serializer_class = CheckSerializer filter_class = CheckFilter + def get_queryset(self): + return Check.objects.prefetch_related('patch', 'user') + class CheckListCreate(CheckMixin, ListCreateAPIView): """List or create checks.""" -- 2.9.3 _______________________________________________ Patchwork mailing list [email protected] https://lists.ozlabs.org/listinfo/patchwork
