treat empty string as an empty value on StreamField too

This commit is contained in:
Matt Westcott 2015-02-11 13:30:26 +00:00
parent 85902d111d
commit bfefcf3bb1

View file

@ -55,7 +55,7 @@ class StreamField(with_metaclass(models.SubfieldBase, models.Field)):
return name, path, args, kwargs
def to_python(self, value):
if value is None:
if value is None or value == '':
return StreamValue(self.stream_block, [])
elif isinstance(value, StreamValue):
return value