mirror of
https://github.com/django/django.git
synced 2025-07-22 20:55:17 +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:
parent
ddcf7dbae7
commit
6a3f31fa33
4 changed files with 42 additions and 25 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue