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

NoneOf and AnyOf can validate multiple valued fields #807

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

azmeuk
Copy link
Member

@azmeuk azmeuk commented Oct 10, 2023

Fixes NoneOf/AnyOf validators not managing SelectMultipleField data.

>>> import wtforms
... from werkzeug.datastructures import ImmutableMultiDict
... class F(wtforms.Form):
...     foo = wtforms.SelectMultipleField(
...         choices=["bar", "baz"],
...         validators=[wtforms.validators.none_of(["baz"])],
...     )
>>> F(ImmutableMultiDict({"foo": "bar"})).validate()
True
>>> F(ImmutableMultiDict({"foo": "baz"})).validate()
True

Replaces #538
Related to #799

@azmeuk azmeuk force-pushed the pr-538-multiple-value-noneof branch from 2333642 to be05a0c Compare October 11, 2024 14:12
@azmeuk azmeuk merged commit c393b48 into pallets-eco:master Oct 11, 2024
8 checks passed
@azmeuk azmeuk deleted the pr-538-multiple-value-noneof branch October 11, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant