Commit 733f03fb by Tom Christie

Fix for emptystring as nullable FK

parent 936fdfb7
...@@ -351,9 +351,9 @@ class RelatedField(WritableField): ...@@ -351,9 +351,9 @@ class RelatedField(WritableField):
value = data.get(field_name) value = data.get(field_name)
if value is None and not self.blank: if value in (None, '') and not self.blank:
raise ValidationError('Value may not be null') raise ValidationError('Value may not be null')
elif value is None and self.blank: elif value in (None, '') and self.blank:
into[(self.source or field_name)] = None into[(self.source or field_name)] = None
else: else:
into[(self.source or field_name)] = self.from_native(value) into[(self.source or field_name)] = self.from_native(value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment