Skip to content

Commit

Permalink
Accept boolean values for Integer field when strict is False
Browse files Browse the repository at this point in the history
  • Loading branch information
mxamin committed Dec 20, 2019
1 parent 9f03e74 commit 11b4d98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/marshmallow/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,10 @@ def _validated(self, value):
):
return super()._validated(value)
raise self.make_error("invalid", input=value)

if value is True or value is False:
value = self._format_num(value)

return super()._validated(value)


Expand Down

0 comments on commit 11b4d98

Please sign in to comment.