mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Avoid passing allow_empty to the ListSerializer children.
This commit is contained in:
parent
39ec564ae9
commit
dcdd765647
|
@ -113,8 +113,12 @@ class BaseSerializer(Field):
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user