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:
|
||||
selected = (
|
||||
str(subvalue) in value and
|
||||
(not has_selected or self.allow_multiple_selected)
|
||||
(not has_selected or self.allow_multiple_selected) and
|
||||
str(subvalue) in value
|
||||
)
|
||||
has_selected |= selected
|
||||
subgroup.append(self.create_option(
|
||||
|
|
Loading…
Reference in New Issue