Skip to content

Commit

Permalink
Fix wrong type of request
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrivas committed Dec 22, 2024
1 parent cb37469 commit 8bd716c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docker-app/qfieldcloud/core/drf_utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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(
Expand Down

0 comments on commit 8bd716c

Please sign in to comment.