1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #29696 -- Prevented BaseModelFormSet.initial_form_count()'s from treating data={} as unbound.

This commit is contained in:
Jon Dufresne
2018-08-21 07:02:03 -07:00
committed by Tim Graham
parent cdc6da395a
commit ef87b38ef7
2 changed files with 8 additions and 2 deletions

View File

@@ -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()