Commit f66853bc authored by Jacob Kaplan-Moss's avatar Jacob Kaplan-Moss
Browse files

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
parent 25e1c39b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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