diff --git a/docker-app/qfieldcloud/core/drf_utils.py b/docker-app/qfieldcloud/core/drf_utils.py index 379aa826b..6e08dcc87 100644 --- a/docker-app/qfieldcloud/core/drf_utils.py +++ b/docker-app/qfieldcloud/core/drf_utils.py @@ -1,5 +1,4 @@ from django.db.models import QuerySet -from django.http import HttpRequest from rest_framework import filters, views from rest_framework.request import Request from typing import Iterable @@ -78,7 +77,7 @@ def remove_invalid_fields( queryset: QuerySet, fields: Iterable[str], view: views.APIView, - request: HttpRequest, + request: Request, ) -> list[str]: """Process ordering fields by parsing custom field expression. @@ -94,8 +93,7 @@ def remove_invalid_fields( Returns : list[str]: parsed ordering fields where aliases have been replaced """ - drf_request = Request(request) - base_fields = super().remove_invalid_fields(queryset, fields, view, drf_request) + base_fields = super().remove_invalid_fields(queryset, fields, view, request) valid_fields = [] for field_name, _verbose_name in self.get_valid_fields(