Skip to content

Commit

Permalink
Fix issue on document patients filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
jbgury committed Sep 3, 2024
1 parent 50da137 commit 2420b3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libreosteoweb/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,10 @@ class PatientDocumentViewSet(viewsets.ModelViewSet):
serializer_class = apiserializers.PatientDocumentSerializer

def get_queryset(self):
patient = self.kwargs['patient']
try:
patient = self.kwargs['patient']
except KeyError:
patient = self.request.query_params.get('patient')
if patient is not None:
queryset = models.PatientDocument.objects.filter(
patient__id=patient).order_by('document__document_date')
Expand Down

0 comments on commit 2420b3d

Please sign in to comment.