summaryrefslogtreecommitdiff
path: root/django/newforms/fields.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-04-26 12:46:04 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-04-26 12:46:04 +0000
commitb24c860fa21790bfe04f5afc7c8bcccb70902f83 (patch)
treedd25150c2d7dd6d7aaf688ee3d2f326458d1ae7b /django/newforms/fields.py
parented60b8645f36b32949b9ed30a8323b49417f7bef (diff)
Fixed #3787, #3788 -- Corrected check for IndexError on MultiValueField, and fixed the value_from_datadict method for MultiWidgets to handle Multiwidgets containing Multiwidgets. Also added a testcase walking through the use of MultiWidget/MultiValueField. Thanks to Max Derkachev for reporting these issues and providing fixes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/fields.py')
-rw-r--r--django/newforms/fields.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/newforms/fields.py b/django/newforms/fields.py
index 7c542b9001..509c099e86 100644
--- a/django/newforms/fields.py
+++ b/django/newforms/fields.py
@@ -457,7 +457,7 @@ class MultiValueField(Field):
for i, field in enumerate(self.fields):
try:
field_value = value[i]
- except KeyError:
+ except IndexError:
field_value = None
if self.required and field_value in EMPTY_VALUES:
raise ValidationError(gettext(u'This field is required.'))