From 613a301a36f9167eec864e80336aee45a916a4e1 Mon Sep 17 00:00:00 2001 From: Christopher Adams Date: Sat, 6 Sep 2014 17:04:35 -0400 Subject: Fixed #1533 - Resolved issue with integer keys on nested choices never validating. - Added unit test for nested `choices` argument. - Added unit test for non-nested `choices` argument. --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rest_framework') diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 8e15345d..c0253f86 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -563,7 +563,7 @@ class ChoiceField(WritableField): if isinstance(v, (list, tuple)): # This is an optgroup, so look inside the group for options for k2, v2 in v: - if value == smart_text(k2): + if value == smart_text(k2) or value == k2: return True else: if value == smart_text(k) or value == k: -- cgit v1.2.3