﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32042	Incorrect messaging when validate_min/validate_max and min_num == max_num.	meghanabhange	meghanabhange	"When using Django Formset, the error messaging isn't checking for the condition where both min_num and max_num are equal and both validate_min and validate_max are set to true. 

{{{
#!div style=""font-size: 80%""
Code highlighting:
  {{{#!python
class TestForm(forms.Form):
    msg = forms.CharField()

test_formset = formset_factory(
  TestForm, 
  min_num=2, 
  max_num=2, 
  validate_min=True, 
  validate_max=True)
  }}}
}}}

When formset is created in the following way and both validate flags are set True the following error messages show up
    - If the supplied forms are less than two - `please submit 2 or more forms` expected `please submit 2 forms` similarly the reverse is also true when the forms are more than two it gives the error message saying `please submit 2 or fewer forms` expected `please submit 2 forms`

This was a [[https://github.com/wagtail/wagtail/issues/6080| bug reported on Wagtail]] and after investigating a little I noticed the incorrect messaging was coming from [[https://github.com/meghanabhange/django/blob/master/django/forms/formsets.py#L340-L356 | this part in the validation ]]"	Cleanup/optimization	closed	Forms	3.1	Normal	fixed	formset, validate_min, validate_max		Ready for checkin	1	0	0	0	0	0
