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

WTForms Version 3.1.0 introduced a breaking change for Flask-Admin forms #2582

Open
chrisdellisantirn opened this issue Dec 20, 2024 · 0 comments

Comments

@chrisdellisantirn
Copy link

chrisdellisantirn commented Dec 20, 2024

It seems that WTForms now returns four elements in iter_choices() tuples instead of the two or three that Flask-Admin expects. As a result, whenever I try to render a form that uses a SelectField or a similar field that relies on iter_choices(), I get:

ValueError: not enough values to unpack (expected 4, got 3)

Downgrading WTForms to 3.0.0 resolved the issue. I checked out their change logs and they show:

⚠️breaking change⚠️: iter_choices now returns a tuple of 4 items

Environment:

  • Python version: 3.10
  • Flask version: 3.1.0
  • Flask-Admin version: 1.6.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant