mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-18 04:02:35 +03:00
fix: Make the instance variable of child serializer point to the correct list object instead of the entire list when validating ListSerializer
This commit is contained in:
parent
f969143c95
commit
a1f03d5ee6
|
@ -612,7 +612,7 @@ class ListSerializer(BaseSerializer):
|
|||
|
||||
if kwargs.get('instance', []) and kwargs.get('data', []):
|
||||
assert len(kwargs.get("data", [])) == len(
|
||||
kwargs.get("instance", [])), 'Data and instance should have same length'
|
||||
kwargs.get("instance", [])), 'Data and instance should have same length'
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
self.child.bind(field_name='', parent=self)
|
||||
|
|
Loading…
Reference in New Issue
Block a user