Skip to content

Commit

Permalink
undo unnecessary change
Browse files Browse the repository at this point in the history
  • Loading branch information
neckenth committed May 3, 2023
1 parent ad4ec1b commit 7704a24
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rest_framework/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,15 +713,13 @@ def _lower_if_str(value):
return value

def to_internal_value(self, data):
try:
with contextlib.suppress(TypeError):
if self._lower_if_str(data) in self.TRUE_VALUES:
return True
elif self._lower_if_str(data) in self.FALSE_VALUES:
return False
elif self._lower_if_str(data) in self.NULL_VALUES and self.allow_null:
return None
except TypeError: # Input is an unhashable type
pass
self.fail("invalid", input=data)

def to_representation(self, value):
Expand Down

0 comments on commit 7704a24

Please sign in to comment.