From 9c3cde244b864a2f71433ee79ea16cab3c92be99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eddy=20Almui=C3=B1a?= Date: Thu, 13 Jan 2022 15:41:54 +0100 Subject: [PATCH] Update fields.py --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index d7e7816ce..dff9253a9 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1456,7 +1456,7 @@ class ChoiceField(Field): # Allows us to deal with eg. integer choices while supporting either # integer or string input, but still get the correct datatype out. self.choice_strings_to_values = { - str(key): key for key in self.choices + str(key): value for key, value in self.choices.items() } choices = property(_get_choices, _set_choices)