Skip to content

validators.length need min_val and max_val #323

@prrvchr

Description

@prrvchr

After an upgrade from 0.20.0 to 0.22.0 I have some code that no longer works:

def isStringValid(value):
    if validators.length(value, min_val=1):
        return True
    return False

To get around the problem I need to modify the code:

def isStringValid(self, value):
    max_val = max(1, len(value))
    if validators.length(value, min_val=1, max_val=max_val):
        return True
    return False

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue: Works not as designed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions