summaryrefslogtreecommitdiff
path: root/django/contrib/admin/widgets.py
diff options
context:
space:
mode:
authorДилян Палаузов <Dilyan.Palauzov@db.com>2018-01-12 09:05:16 -0500
committerTim Graham <timograham@gmail.com>2018-01-12 12:44:50 -0500
commita38ae914d89809aed6d79337b74a8b31b6d3849a (patch)
tree42a8465e37fc02b70d8d3f876d23947acb1a2455 /django/contrib/admin/widgets.py
parent4bcec02368b7e5466f64dc17286689b16613c94b (diff)
Fixed #28996 -- Simplified some boolean constructs and removed trivial continue statements.
Diffstat (limited to 'django/contrib/admin/widgets.py')
-rw-r--r--django/contrib/admin/widgets.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/django/contrib/admin/widgets.py b/django/contrib/admin/widgets.py
index 2e55ef65b2..40afe0773f 100644
--- a/django/contrib/admin/widgets.py
+++ b/django/contrib/admin/widgets.py
@@ -438,8 +438,7 @@ class AutocompleteMixin:
str(option_value) in value and
(has_selected is False or self.allow_multiple_selected)
)
- if selected is True and has_selected is False:
- has_selected = True
+ has_selected |= selected
index = len(default[1])
subgroup = default[1]
subgroup.append(self.create_option(name, option_value, option_label, selected_choices, index))