summaryrefslogtreecommitdiff
path: root/django/forms/formsets.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-03-17 19:23:23 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-03-17 19:23:23 +0000
commitf66853bccae312e3d7f37048e5baaccabc86d18e (patch)
tree0d1236d5a23ae3f5ece4185c53a4330a24b76bd5 /django/forms/formsets.py
parent25e1c39bc35fdc013627fa29c8c6cf24fc705fe1 (diff)
Fixed `BaseFormSet.is_multipart()` so that it doesn't bomb when called on an empty formset.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms/formsets.py')
-rw-r--r--django/forms/formsets.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/formsets.py b/django/forms/formsets.py
index 10306c7e6d..7a5cb8a439 100644
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -258,7 +258,7 @@ class BaseFormSet(StrAndUnicode):
Returns True if the formset needs to be multipart-encrypted, i.e. it
has FileInput. Otherwise, False.
"""
- return self.forms[0].is_multipart()
+ return self.forms and self.forms[0].is_multipart()
def _get_media(self):
# All the forms on a FormSet are the same, so you only need to