From ef87b38ef7b07a5a9b4ee424a04a9811836dee39 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 21 Aug 2018 07:02:03 -0700 Subject: Fixed #29696 -- Prevented BaseModelFormSet.initial_form_count()'s from treating data={} as unbound. --- django/forms/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/forms') diff --git a/django/forms/models.py b/django/forms/models.py index aa35ef5f92..7648d97da4 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -570,7 +570,7 @@ class BaseModelFormSet(BaseFormSet): def initial_form_count(self): """Return the number of forms that are required in this FormSet.""" - if not (self.data or self.files): + if not self.is_bound: return len(self.get_queryset()) return super().initial_form_count() -- cgit v1.3