mirror of
https://github.com/django/django.git
synced 2025-10-27 15:46:10 +00:00
[1.10.x] Fixed #26927 -- Made subwidget iteration pass disabled and required attributes.
Backport of ac3aaaa740 from master
This commit is contained in:
@@ -787,6 +787,13 @@ class CheckboxSelectMultiple(RendererMixin, SelectMultiple):
|
||||
renderer = CheckboxFieldRenderer
|
||||
_empty_value = []
|
||||
|
||||
def build_attrs(self, extra_attrs=None, **kwargs):
|
||||
attrs = super(CheckboxSelectMultiple, self).build_attrs(extra_attrs, **kwargs)
|
||||
# Remove the 'required' attribute because browser validation would
|
||||
# require all checkboxes to be checked instead of at least one.
|
||||
attrs.pop('required', None)
|
||||
return attrs
|
||||
|
||||
|
||||
class MultiWidget(Widget):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user