#16479: Forms generated from formsets use ErrorList instead of supplied 
error_class
-----------------------------+----------------------------
 Reporter:  marcin.tustin@…  |          Owner:  nobody
     Type:  Bug              |         Status:  new
Milestone:                   |      Component:  Forms
  Version:  1.3              |       Severity:  Normal
 Keywords:  forms formsets   |   Triage Stage:  Unreviewed
Has patch:  1                |  Easy pickings:  1
    UI/UX:  0                |
-----------------------------+----------------------------
 Using Django 1.3, forms generated from formsets use ErrorList instead of
 supplied error_class.

 Accordingly, even though a formset is instantiated:

                 directors_formset = DirectorsFormset(prefix='directors',
                                                      data=request.POST,
 error_class=SideError)

 Forms generated from it use the default ErrorList ul style of error
 rendering.

 The fix is in the first line of FormSet._construct_form, which currently
 reads:
     defaults = {'auto_id': self.auto_id, 'prefix': self.add_prefix(i)}
 
(https://code.djangoproject.com/browser/django/trunk/django/forms/formsets.py#L114)

 This should be changed to:
         defaults = {'auto_id': self.auto_id, 'prefix': self.add_prefix(i),
 'error_class': self.error_class}
 Which passes the error_class down to every form instantiated.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16479>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to