Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Avoid passing allow_empty to the ListSerializer children.
  • Loading branch information
xordoquy committed Sep 3, 2015
commit dcdd765647b28135dc764f038e9380cf1ccc0ecc
6 changes: 5 additions & 1 deletion rest_framework/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ def many_init(cls, *args, **kwargs):
kwargs['child'] = cls()
return CustomListSerializer(*args, **kwargs)
"""
allow_empty = kwargs.pop('allow_empty', True)
child_serializer = cls(*args, **kwargs)
list_kwargs = {'child': child_serializer}
list_kwargs = {
'child': child_serializer,
'allow_empty': allow_empty,
}
list_kwargs.update(dict([
(key, value) for key, value in kwargs.items()
if key in LIST_SERIALIZER_KWARGS
Expand Down