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

Fixed #28130 -- Fixed formset min_num validation with initial, unchanged forms.

Regression in f5c6295797.
This commit is contained in:
Tim Graham
2017-04-28 09:32:40 -04:00
committed by GitHub
parent eb4724a063
commit f04a404917
3 changed files with 30 additions and 1 deletions

View File

@@ -322,7 +322,8 @@ class BaseFormSet:
return
for i in range(0, self.total_form_count()):
form = self.forms[i]
if not form.has_changed():
# Empty forms are unchanged forms beyond those with initial data.
if not form.has_changed() and i >= self.initial_form_count():
empty_forms_count += 1
self._errors.append(form.errors)