Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.0.X] Fixed `BaseFormSet.is_multipart()` so that it doesn't bomb wh…

…en called on an empty formset.

Backport of [10073] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10075 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6b850951697437126b448e5126c273a389e8a749 1 parent 4d67631
@jacobian jacobian authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/forms/formsets.py
View
2  django/forms/formsets.py
@@ -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.