Commit 8d6b0b1f by Julio Iván Alegre

Update serializers.py

Treat the input queryset as it comes (maybe it has been changed in a higher level). Evaluating .all() does nothing if or if not is a queryset.
parent f5b783af
......@@ -517,9 +517,8 @@ class ListSerializer(BaseSerializer):
"""
List of object instances -> List of dicts of primitive datatypes.
"""
iterable = data.all() if (hasattr(data, 'all')) else data
return [
self.child.to_representation(item) for item in iterable
self.child.to_representation(item) for item in data
]
def validate(self, attrs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment