Fixed a bug introduced by [10316].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10319 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2009-04-01 14:45:39 +00:00
parent ee17cabba0
commit 6474092e9a
1 changed files with 6 additions and 1 deletions

View File

@ -422,7 +422,12 @@ class NullBooleanSelect(Select):
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, None)
return {u'2': True, u'3': False, 'True': True, 'False': False}.get(value, None) return {u'2': True,
True: True,
'True': True,
u'3': False,
'False': False,
False: False}.get(value, None)
def _has_changed(self, initial, data): def _has_changed(self, initial, data):
# Sometimes data or initial could be None or u'' which should be the # Sometimes data or initial could be None or u'' which should be the