Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed `BaseFormSet.is_multipart()` so that it doesn't bomb when calle…

…d on an empty formset.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f66853bccae312e3d7f37048e5baaccabc86d18e 1 parent 25e1c39
Jacob Kaplan-Moss jacobian authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/forms/formsets.py
2  django/forms/formsets.py
View
@@ -258,7 +258,7 @@ def is_multipart(self):
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
Please sign in to comment.
Something went wrong with that request. Please try again.