From a369feaa72ca9b5e1840b315a5e037246bfcdeb8 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Sat, 10 Feb 2024 20:19:23 +0530 Subject: [PATCH] Fix prefetch_related in PatientInvestigationViewSet (#1882) fix investigations list view --- care/facility/api/viewsets/patient_investigation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/care/facility/api/viewsets/patient_investigation.py b/care/facility/api/viewsets/patient_investigation.py index 4d1bd64e26..bb9682abff 100644 --- a/care/facility/api/viewsets/patient_investigation.py +++ b/care/facility/api/viewsets/patient_investigation.py @@ -74,7 +74,7 @@ class PatientInvestigationViewSet( mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet ): serializer_class = PatientInvestigationSerializer - queryset = PatientInvestigation.objects.all().select_related("groups") + queryset = PatientInvestigation.objects.all().prefetch_related("groups") lookup_field = "external_id" permission_classes = (IsAuthenticated,) filterset_class = PatientInvestigationFilter