Browse files

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

…d on an empty formset.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 25e1c39 commit f66853bccae312e3d7f37048e5baaccabc86d18e @jacobian jacobian committed Mar 17, 2009
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 f66853b

Please sign in to comment.