From 71ccab593b7ea7e3a1ab5dd971365c57822454ae Mon Sep 17 00:00:00 2001 From: Joel Marcotte Date: Sat, 15 Dec 2012 10:35:06 -0500 Subject: Fix for JSON integer match to a ChoiceField --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rest_framework/fields.py') diff --git a/rest_framework/fields.py b/rest_framework/fields.py index da588082..903c384e 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -794,7 +794,7 @@ class ChoiceField(WritableField): if value == smart_unicode(k2): return True else: - if value == smart_unicode(k): + if value == smart_unicode(k) or value == k: return True return False -- cgit v1.2.3 From 6f25181979084e769658748ea342ff088ad245c0 Mon Sep 17 00:00:00 2001 From: Joel Marcotte Date: Sat, 15 Dec 2012 16:45:04 -0500 Subject: Reverting commit to previous state to see if the test is only relevant to django 1.5b2 --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rest_framework/fields.py') diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 903c384e..da588082 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -794,7 +794,7 @@ class ChoiceField(WritableField): if value == smart_unicode(k2): return True else: - if value == smart_unicode(k) or value == k: + if value == smart_unicode(k): return True return False -- cgit v1.2.3 From 262d9c248918d1e9a2e6ee8008aca94e2e23dd82 Mon Sep 17 00:00:00 2001 From: Joel Marcotte Date: Sat, 15 Dec 2012 16:52:28 -0500 Subject: Final commit to restore the fix Signed-off-by: Joel Marcotte --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rest_framework/fields.py') diff --git a/rest_framework/fields.py b/rest_framework/fields.py index da588082..903c384e 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -794,7 +794,7 @@ class ChoiceField(WritableField): if value == smart_unicode(k2): return True else: - if value == smart_unicode(k): + if value == smart_unicode(k) or value == k: return True return False -- cgit v1.2.3