From 5c90bf9cc00e9870ba1d1d5bd3113ce797e73306 Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Mon, 1 Jun 2015 16:13:35 +0100 Subject: [PATCH] Fix for #2894 thanks to @carljm --- rest_framework/fields.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index d8bb0a017..e7a4cee5f 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1060,7 +1060,11 @@ class MultipleChoiceField(ChoiceField): # We override the default field access in order to support # lists in HTML forms. if html.is_html_input(dictionary): - return dictionary.getlist(self.field_name) + ret = dictionary.getlist(self.field_name) + if getattr(self.root, 'partial', False) and not ret: + ret = empty + return ret + return dictionary.get(self.field_name, empty) def to_internal_value(self, data):