Fixed #14407 -- Simplified ManyToManyRawIdWidget.value_from_datadict, Thanks tyrion!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14283 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Honza Král 2010-10-19 07:14:38 +00:00
parent 634d0a92b8
commit f6a0b7cfe3
1 changed files with 2 additions and 5 deletions

View File

@ -172,12 +172,9 @@ class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
return ''
def value_from_datadict(self, data, files, name):
value = data.get(name, None)
if value and ',' in value:
return data[name].split(',')
value = data.get(name)
if value:
return [value]
return None
return value.split(',')
def _has_changed(self, initial, data):
if initial is None: