summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/widgets.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 8eb5fef3e7..6ee857a9fd 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -595,10 +595,9 @@ class SelectMultiple(Select):
data = []
if len(initial) != len(data):
return True
- for value1, value2 in zip(initial, data):
- if force_unicode(value1) != force_unicode(value2):
- return True
- return False
+ initial_set = set([force_unicode(value) for value in initial])
+ data_set = set([force_unicode(value) for value in data])
+ return data_set != initial_set
class RadioInput(StrAndUnicode):
"""