chore: support for wtforms 3.1

This commit is contained in:
Éloi Rivard 2023-10-11 14:44:35 +02:00
parent eb7338c76c
commit 8d4c015fbc
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
2 changed files with 6 additions and 2 deletions

View file

@ -179,7 +179,11 @@
<a class="badge badge-secondary" href="#" id="selectnone" onclick="selectCheckboxes(false)">{{_("No one")}}</a>
</p>
<div class="d-flex flex-column flex-wrap overflow-auto" style="max-height: 20em;">
{% for key, value, checked in form.payed_for.iter_choices() | sort(attribute='1') %}
{% for choices in form.payed_for.iter_choices() | sort(attribute='1') %}
{# Compatibility with wtforms<3.1 #}
{% set key = choices[0] %}
{% set value = choices[1] %}
{% set checked = choices[2] %}
<p class="form-check text-break" style="max-width: 50%;">
<label for="payed_for-{{key}}" class="form-check-label">
<input name="payed_for" type="checkbox" {% if checked %}checked{% endif %} class="form-check-input" value="{{key}}" id="payed_for-{{key}}"/>

View file

@ -38,7 +38,7 @@ dependencies = [
"Flask-SQLAlchemy>=2.4,<3",
"Flask-Talisman>=0.8,<2",
"Flask-WTF>=0.14.3,<2",
"WTForms>=2.3.1,<3.1",
"WTForms>=2.3.1,<3.2",
"Flask>=2,<2.3",
"Werkzeug>=2,<2.3",
"itsdangerous>=2,<3",