Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes issues with patient annotate + distinct not implemented for csv export #1999

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions care/facility/api/viewsets/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,14 @@
else:
return self.serializer_class

def filter_queryset(self, queryset: QuerySet) -> QuerySet:
if self.action == "list" and settings.CSV_REQUEST_PARAMETER in self.request.GET:
for backend in (PatientDRYFilter, filters.DjangoFilterBackend):
queryset = backend().filter_queryset(self.request, queryset, self)
return queryset

Check warning on line 413 in care/facility/api/viewsets/patient.py

View check run for this annotation

Codecov / codecov/patch

care/facility/api/viewsets/patient.py#L412-L413

Added lines #L412 - L413 were not covered by tests

return super().filter_queryset(queryset)

def list(self, request, *args, **kwargs):
"""
Patient List
Expand Down
Loading