From ff49d5651aa8eb62f497640609bc201b27805420 Mon Sep 17 00:00:00 2001 From: Amin Solhizadeh Date: Tue, 17 Dec 2019 15:51:56 +0100 Subject: [PATCH] Accept boolean values for Integer field when strict is False --- src/marshmallow/fields.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py index 4458fab1a..a5e2396c9 100644 --- a/src/marshmallow/fields.py +++ b/src/marshmallow/fields.py @@ -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)