mirror of https://github.com/django/django.git
Improved performance of django.forms.ChoiceWidget.optgroups().
This commit is contained in:
parent
8a642b88c3
commit
54102d20b2
|
@ -606,8 +606,8 @@ class ChoiceWidget(Widget):
|
||||||
|
|
||||||
for subvalue, sublabel in choices:
|
for subvalue, sublabel in choices:
|
||||||
selected = (
|
selected = (
|
||||||
str(subvalue) in value and
|
(not has_selected or self.allow_multiple_selected) and
|
||||||
(not has_selected or self.allow_multiple_selected)
|
str(subvalue) in value
|
||||||
)
|
)
|
||||||
has_selected |= selected
|
has_selected |= selected
|
||||||
subgroup.append(self.create_option(
|
subgroup.append(self.create_option(
|
||||||
|
|
Loading…
Reference in New Issue