File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -1042,16 +1042,10 @@ def to_internal_value(self, data):
1042
1042
except KeyError :
1043
1043
self .fail ('invalid_choice' , input = data )
1044
1044
1045
- def representation_value (self , value ):
1046
- try :
1047
- return self .choice_strings_to_values [six .text_type (value )]
1048
- except KeyError :
1049
- return value
1050
-
1051
1045
def to_representation (self , value ):
1052
1046
if value in ('' , None ):
1053
1047
return value
1054
- return self .representation_value ( value )
1048
+ return self .choice_strings_to_values . get ( six . text_type ( value ), value )
1055
1049
1056
1050
1057
1051
class MultipleChoiceField (ChoiceField ):
@@ -1079,7 +1073,7 @@ def to_internal_value(self, data):
1079
1073
1080
1074
def to_representation (self , value ):
1081
1075
return set ([
1082
- self .representation_value ( item ) for item in value
1076
+ self .choice_strings_to_values . get ( six . text_type ( item ), item ) for item in value
1083
1077
])
1084
1078
1085
1079
You can’t perform that action at this time.
0 commit comments