Author: jacob Date: 2009-03-17 14:23:23 -0500 (Tue, 17 Mar 2009) New Revision: 10073
Modified: django/trunk/django/forms/formsets.py Log: Fixed `BaseFormSet.is_multipart()` so that it doesn't bomb when called on an empty formset. Modified: django/trunk/django/forms/formsets.py =================================================================== --- django/trunk/django/forms/formsets.py 2009-03-17 16:13:09 UTC (rev 10072) +++ django/trunk/django/forms/formsets.py 2009-03-17 19:23:23 UTC (rev 10073) @@ -258,7 +258,7 @@ 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---