summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorheathervm <heathervmurray@gmail.com>2017-03-31 07:10:08 -0700
committerTim Graham <timograham@gmail.com>2017-03-31 10:10:30 -0400
commitff0c6b83e590e36555639563c4bd1d808f416455 (patch)
treeda0ec13758cd5a98d460cace87cdb89a2e239a7c /django/forms
parent8484cf4cd0a6d3553f6fc1d62fa6dc04f04624f0 (diff)
[1.11.x] Fixed #27993 -- Fixed model form default fallback for SelectMultiple.
Backport of 7d1e23775344cc3dead03bd4af45f4fdf134b819 from master
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/widgets.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 686c092795..7e4206a00b 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -736,6 +736,11 @@ class SelectMultiple(Select):
getter = data.get
return getter(name)
+ def value_omitted_from_data(self, data, files, name):
+ # An unselected <select multiple> doesn't appear in POST data, so it's
+ # never known if the value is actually omitted.
+ return False
+
class RadioSelect(ChoiceWidget):
input_type = 'radio'