Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validators.length need min_val and max_val #323

Closed
prrvchr opened this issue Jan 15, 2024 · 1 comment · Fixed by #334
Closed

validators.length need min_val and max_val #323

prrvchr opened this issue Jan 15, 2024 · 1 comment · Fixed by #334
Labels
bug Issue: Works not as designed
Milestone

Comments

@prrvchr
Copy link

prrvchr commented Jan 15, 2024

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
@yozachar yozachar added bug Issue: Works not as designed maintenance PR: Alters existing source code and removed maintenance PR: Alters existing source code labels Jan 16, 2024
@yozachar yozachar added this to the 0.23.1 milestone Mar 19, 2024
@yozachar yozachar linked a pull request Mar 19, 2024 that will close this issue
@prrvchr
Copy link
Author

prrvchr commented Mar 19, 2024

Ok, thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue: Works not as designed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants