aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
authorChristopher Adams2014-09-06 17:04:35 -0400
committerChristopher Adams2014-09-06 17:13:28 -0400
commit613a301a36f9167eec864e80336aee45a916a4e1 (patch)
tree8aa42a11eeb0634157b22cc8e50422b573b47bbc /rest_framework
parent2b47c6b700be530605bd30f0afe7214ea376bd13 (diff)
downloaddjango-rest-framework-613a301a36f9167eec864e80336aee45a916a4e1.tar.bz2
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.
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/fields.py2
1 files changed, 1 insertions, 1 deletions
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: