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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
jacobian committed Mar 17, 2009
1 parent 4d67631 commit 6b850951697437126b448e5126c273a389e8a749
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/forms/
@@ -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

0 comments on commit 6b85095

Please sign in to comment.