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 17, 2019
1 parent 13e5240 commit ff49d56
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 ff49d56

Please sign in to comment.