Fix for empty form fields

This commit is contained in:
Tom Christie 2012-10-03 12:56:01 +01:00
parent f4ad77ac04
commit 27c93c08d2

View File

@ -250,7 +250,10 @@ class ManyPrimaryKeyRelatedField(PrimaryKeyRelatedField):
value = data.getlist(field_name)
except:
value = data.get(field_name)
into[field_name] = [self.from_native(item) for item in value if item]
else:
if value == ['']:
value = []
into[field_name] = [self.from_native(item) for item in value]
class NaturalKeyRelatedField(RelatedField):