From a613a326283e709a05c681f6c691c3994e91ab67 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 4 Aug 2020 15:59:31 +0300 Subject: [PATCH] prefetch: fix handling of the prefetch param. --- django_etebase/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_etebase/views.py b/django_etebase/views.py index 2678451..95031e3 100644 --- a/django_etebase/views.py +++ b/django_etebase/views.py @@ -190,7 +190,7 @@ class CollectionViewSet(BaseViewSet): def get_serializer_context(self): context = super().get_serializer_context() - prefetch = self.request.query_params.get('prefetch', True) + prefetch = self.request.query_params.get('prefetch', 'true') != 'false' context.update({'request': self.request, 'prefetch': prefetch}) return context @@ -256,7 +256,7 @@ class CollectionItemViewSet(BaseViewSet): def get_serializer_context(self): context = super().get_serializer_context() - prefetch = self.request.query_params.get('prefetch', True) + prefetch = self.request.query_params.get('prefetch', 'true') != 'false' context.update({'request': self.request, 'prefetch': prefetch}) return context