#20872: Bad error message if INITIAL_FORMS/TOTAL_FORMS > MAX_NUM_FORMS
------------------------------------+------------------------
               Reporter:  russellm  |          Owner:  nobody
                   Type:  Bug       |         Status:  new
              Component:  Forms     |        Version:  1.5
               Severity:  Normal    |       Keywords:
           Triage Stage:  Accepted  |      Has patch:  0
    Needs documentation:  0         |    Needs tests:  0
Patch needs improvement:  0         |  Easy pickings:  0
                  UI/UX:  0         |
------------------------------------+------------------------
 Formset handling currently enforces a MAX_NUM_FORMS check on incoming form
 data. However, there is no checking or validation that MAX_NUM_FORMS is
 actually equal to or greater than INITIAL_FORMS/TOTAL_FORMS.

 As a result, it's possible to construct and display a formset, but then
 have that formset fail (with a "list index out of range error") on form
 submission.

 This manifested for me as the following: A model in the admin with
 inlines; the inline was filled with 2023 inline objects, and the default
 MAX_NUM_FORMS (1000 was in use. The page takes a long time to load, but it
 *does* load; when you hit submit, you get the "list index out of range"
 error as a 500 page, with no suggestion of the underlying problem.

 I haven't tested, but AFAICT, the same problem will manifest with a lot
 less data if you set MAX_NUM_FORMS to a lower value.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20872>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.460d86291727198fcd20eaaf6774d243%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to