Skip to content

Integer field won't accept boolean value when strict is False #1475

@mxamin

Description

@mxamin

As mentioned in the documentation, for Integer fields when the strict parameter is False any value that is castable to integer is acceptable:

strict – If True, only integer types are valid. Otherwise, any value castable to int is valid.

But actually, if you pass True or False when strict is False the validation will fail although boolean values are castable to int:

assert int(True) == 1
assert int(False) == 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions