Skip to content

Commit

Permalink
fix: 'Bill Type: Invalid Choice: could not coerce' error
Browse files Browse the repository at this point in the history
Error introduced in #1290. Fixes #1293. WTForms needs to be bumped to >=2.3.2
as it includes a fix to `SelectField` which is required for this change to work.

See:
  - https://wtforms.readthedocs.io/en/3.1.x/changes/#version-2-3-2
  - pallets-eco/wtforms#598
  • Loading branch information
rriski authored and zorun committed Mar 28, 2024
1 parent ae1cc30 commit a3d4e42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ihatemoney/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class BillType(Enum):

@classmethod
def choices(cls):
return [(choice, choice.value) for choice in cls]
return [(choice.value, choice.value) for choice in cls]


db = SQLAlchemy()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies = [
"Flask-SQLAlchemy>=2.4,<3",
"Flask-Talisman>=0.8,<2",
"Flask-WTF>=0.14.3,<2",
"WTForms>=2.3.1,<3.2",
"WTForms>=2.3.3,<3.2",
"Flask>=2,<3",
"Werkzeug>=2,<3",
"itsdangerous>=2,<3",
Expand Down

0 comments on commit a3d4e42

Please sign in to comment.