Skip to content

Commit 0e87688

Browse files
committed
Copy included_resources before removing items from it
Fixes #131
1 parent 603dc3b commit 0e87688

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework_json_api/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Utils.
33
"""
44
import copy
5+
56
import inflection
67
from django.conf import settings
78
from django.utils import six, encoding
@@ -421,7 +422,7 @@ def extract_included(fields, resource, resource_instance, included_resources):
421422
continue
422423

423424
try:
424-
included_resources.remove(field_name)
425+
included_resources.copy().remove(field_name)
425426
except ValueError:
426427
# Skip fields not in requested included resources
427428
continue

0 commit comments

Comments
 (0)