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:
parent
634d0a92b8
commit
f6a0b7cfe3
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue