mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 04:07:39 +03:00
Updated NestedBoundField to also handle empty string when rendering its form
If a NestedBoundField field has a value of `None` and is inside another NestedBoundField field, it will have its value converted to an empty string while the form of its enclosing field is being rendered. So, NestedBoundField fields with an empty string value must be handled the same way as NestedBoundField fields with a `None` value.
This commit is contained in:
parent
200dda91ac
commit
570187b959
|
@ -90,7 +90,7 @@ class NestedBoundField(BoundField):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, field, value, errors, prefix=''):
|
def __init__(self, field, value, errors, prefix=''):
|
||||||
if value is None:
|
if value is None or value is '':
|
||||||
value = {}
|
value = {}
|
||||||
super(NestedBoundField, self).__init__(field, value, errors, prefix)
|
super(NestedBoundField, self).__init__(field, value, errors, prefix)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user