Skip to content

Logic bug in Attribute's default value checker #1169

Open
@michaelstoops

Description

@michaelstoops

Attribute.__init__ has a checker to prevent specifying both default and default_for_new. The code intends to check for the presence of these values, but implicitly converts them to boolean, leading to the false assumption that they are not present. The impact is that default values which convert to False will not be checked.

For example, you can specify default to be any of these: 0, "", False; and also specify default_for_new. The code will not catch the error that both default and default_for_new have been specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions