mirror of
https://github.com/django/django.git
synced 2025-07-19 00:59:17 +00:00
[1.0.X] Fixed BaseFormSet.is_multipart()
so that it doesn't bomb when 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
This commit is contained in:
parent
4d6763128f
commit
6b85095169
@ -258,7 +258,7 @@ class BaseFormSet(StrAndUnicode):
|
|||||||
Returns True if the formset needs to be multipart-encrypted, i.e. it
|
Returns True if the formset needs to be multipart-encrypted, i.e. it
|
||||||
has FileInput. Otherwise, False.
|
has FileInput. Otherwise, False.
|
||||||
"""
|
"""
|
||||||
return self.forms[0].is_multipart()
|
return self.forms and self.forms[0].is_multipart()
|
||||||
|
|
||||||
def _get_media(self):
|
def _get_media(self):
|
||||||
# All the forms on a FormSet are the same, so you only need to
|
# All the forms on a FormSet are the same, so you only need to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user