Tweak empty list implementation

This commit is contained in:
Tom Christie 2013-01-30 14:21:18 +00:00
parent be6df3ae3c
commit e24d29ec05

View File

@ -129,8 +129,8 @@ class RelatedField(WritableField):
try:
# Form data
value = data.getlist(field_name)
if value == ['']:
value = []
if value == [''] or value == []:
raise KeyError
except AttributeError:
# Non-form data
value = data[field_name]