Skip to content

validators.length need min_val and max_val #323

Closed

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

Activity

  1. added
    bugIssue: Works not as designed
    maintenancePR: Alters existing source code
    and removed
    maintenancePR: Alters existing source code
    on Jan 16, 2024
  2. added this to the 0.23.1 milestone on Mar 19, 2024
  3. linked a pull request that will close this issuemaint: fix `between` & `length` validators #334on Mar 19, 2024
  4. prrvchr commented on Mar 19, 2024

    @prrvchr
    Author

    Ok, thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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