Skip to content

DjangoFilterBackend.get_filterset_kwargs doesn't modify data dict while iterating #580

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

Merged
merged 7 commits into from
Mar 2, 2019
3 changes: 1 addition & 2 deletions rest_framework_json_api/django_filters/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.exceptions import ValidationError
from rest_framework.settings import api_settings

from rest_framework_json_api.utils import format_value


Expand Down Expand Up @@ -102,7 +101,7 @@ def get_filterset_kwargs(self, request, queryset, view):
filter_keys = []
# rewrite filter[field] query params to make DjangoFilterBackend work.
data = request.query_params.copy()
for qp, val in data.items():
for qp, val in request.query_params.items():
m = self.filter_regex.match(qp)
if m and (not m.groupdict()['assoc'] or
m.groupdict()['ldelim'] != '[' or m.groupdict()['rdelim'] != ']'):
Expand Down