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 '' return ''
def value_from_datadict(self, data, files, name): def value_from_datadict(self, data, files, name):
value = data.get(name, None) value = data.get(name)
if value and ',' in value:
return data[name].split(',')
if value: if value:
return [value] return value.split(',')
return None
def _has_changed(self, initial, data): def _has_changed(self, initial, data):
if initial is None: if initial is None: