Fix processing of ManyToManyField when it is empty

Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>
This commit is contained in:
Fernando Rocha 2013-01-29 18:46:05 -03:00
parent 1929159db1
commit fceacd830f

View File

@ -148,7 +148,7 @@ class ManyRelatedMixin(object):
value = data.getlist(self.source or field_name) value = data.getlist(self.source or field_name)
except: except:
# Non-form data # Non-form data
value = data.get(self.source or field_name) value = data.get(self.source or field_name, [])
else: else:
if value == ['']: if value == ['']:
value = [] value = []