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
Updated NestedBoundField to also handle empty string when rendering i…
…ts 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.
  • Loading branch information
Ernest0x committed Nov 26, 2015
commit 570187b959575822febf838464ea46282cf21654
2 changes: 1 addition & 1 deletion rest_framework/utils/serializer_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class NestedBoundField(BoundField):
"""

def __init__(self, field, value, errors, prefix=''):
if value is None:
if value is None or value is '':
value = {}
super(NestedBoundField, self).__init__(field, value, errors, prefix)

Expand Down