chore: support for wtforms 3.1 (#1248)

This commit is contained in:
Éloi Rivard 2023-10-18 23:47:21 +02:00 committed by GitHub
parent eb7338c76c
commit c9a709953f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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> <a class="badge badge-secondary" href="#" id="selectnone" onclick="selectCheckboxes(false)">{{_("No one")}}</a>
</p> </p>
<div class="d-flex flex-column flex-wrap overflow-auto" style="max-height: 20em;"> <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%;"> <p class="form-check text-break" style="max-width: 50%;">
<label for="payed_for-{{key}}" class="form-check-label"> <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}}"/> <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-SQLAlchemy>=2.4,<3",
"Flask-Talisman>=0.8,<2", "Flask-Talisman>=0.8,<2",
"Flask-WTF>=0.14.3,<2", "Flask-WTF>=0.14.3,<2",
"WTForms>=2.3.1,<3.1", "WTForms>=2.3.1,<3.2",
"Flask>=2,<2.3", "Flask>=2,<2.3",
"Werkzeug>=2,<2.3", "Werkzeug>=2,<2.3",
"itsdangerous>=2,<3", "itsdangerous>=2,<3",