Skip to content

Commit

Permalink
Updated NestedBoundField to also handle empty string when rendering i…
Browse files Browse the repository at this point in the history
…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
1 parent 200dda9 commit 570187b
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 570187b

Please sign in to comment.