From 960bebd2a37e0226d60c0bccb86f17ad17b99d5a Mon Sep 17 00:00:00 2001 From: Saadullah Aleem Date: Tue, 2 May 2023 13:33:34 +0500 Subject: [PATCH] fix formatting --- rest_framework/fields.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index bccb3a7f5..772754f5e 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1440,8 +1440,7 @@ class ChoiceField(Field): # integer or string input, but still get the correct datatype out. self.choice_strings_to_values = { str(key.value) if isinstance(key, (IntegerChoices, TextChoices)) - and str(key) != str( - key.value) else str(key): key for key in self.choices + and str(key) != str(key.value) else str(key): key for key in self.choices } choices = property(_get_choices, _set_choices)