Update fields.py

This commit is contained in:
Eddy Almuiña 2022-01-13 15:41:54 +01:00 committed by GitHub
parent c5be86a6db
commit 9c3cde244b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)