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: try:
# Form data # Form data
value = data.getlist(field_name) value = data.getlist(field_name)
if value == ['']: if value == [''] or value == []:
value = [] raise KeyError
except AttributeError: except AttributeError:
# Non-form data # Non-form data
value = data[field_name] value = data[field_name]