mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #15722: ensure formsets evaluate to True even if they have no forms. Thanks mlavin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16756 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -60,6 +60,10 @@ class BaseFormSet(StrAndUnicode):
|
||||
def __len__(self):
|
||||
return len(self.forms)
|
||||
|
||||
def __nonzero__(self):
|
||||
"""All formsets have a management form which is not included in the length"""
|
||||
return True
|
||||
|
||||
def _management_form(self):
|
||||
"""Returns the ManagementForm instance for this FormSet."""
|
||||
if self.is_bound:
|
||||
|
||||
Reference in New Issue
Block a user