Skip to content

NoneOf and AnyOf can validate multiple valued fields - #807

Merged
azmeuk merged 1 commit into
pallets-eco:masterfrom
azmeuk:pr-538-multiple-value-noneof
Oct 11, 2024
Merged

azmeuk merged 1 commit into
pallets-eco:masterfrom
azmeuk:pr-538-multiple-value-noneof

Conversation

@azmeuk

@azmeuk azmeuk commented Oct 10, 2023

Copy link
Copy Markdown
Member

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
@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