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

2.3.0 breaks rendering of SelectField with no choices #585

Closed
c-thiel opened this issue Apr 22, 2020 · 1 comment
Closed

2.3.0 breaks rendering of SelectField with no choices #585

c-thiel opened this issue Apr 22, 2020 · 1 comment
Labels
bug Unexpected behavior

Comments

@c-thiel
Copy link

c-thiel commented Apr 22, 2020

Actual Behavior

from wtforms import Form, SelectField, validators

class MyForm(Form):
    my_field = SelectField(label='MyField', choices=[])

form = MyForm()
form.meta.render_field(form.my_field, {})

Results in

IndexError: list index out of range

Due to:

if isinstance(self.choices[0], (list, tuple)):

Environment

  • Python version: Any
  • wtforms version: 2.3.0
@azmeuk
Copy link
Member

azmeuk commented Apr 22, 2020

Should be fixed by #582

@azmeuk azmeuk added the bug Unexpected behavior label Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior
Development

No branches or pull requests

3 participants