diff options
| author | Glandos <bugs-github@antipoul.fr> | 2021-06-09 23:32:53 +0200 |
|---|---|---|
| committer | Glandos <bugs-github@antipoul.fr> | 2021-06-09 23:38:05 +0200 |
| commit | 69a1ad66856b91c123b5484323bbd67b6e46d0a0 (patch) | |
| tree | 3636e0d4a5b4fb98885bbf771a9463ce32ad12ac /ihatemoney | |
| parent | 6c43ffaac4d3ad2e13c30d1e4945a6e5010afb5c (diff) | |
| download | ihatemoney-mirror-69a1ad66856b91c123b5484323bbd67b6e46d0a0.zip ihatemoney-mirror-69a1ad66856b91c123b5484323bbd67b6e46d0a0.tar.gz ihatemoney-mirror-69a1ad66856b91c123b5484323bbd67b6e46d0a0.tar.bz2 | |
Adapt code for https://github.com/wtforms/wtforms/pull/568
Diffstat (limited to 'ihatemoney')
| -rw-r--r-- | ihatemoney/web.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ihatemoney/web.py b/ihatemoney/web.py index d16cf55..106a85c 100644 --- a/ihatemoney/web.py +++ b/ihatemoney/web.py @@ -161,7 +161,7 @@ def admin(): client_ip = request.remote_addr if not login_throttler.is_login_allowed(client_ip): msg = _("Too many failed login attempts, please retry later.") - form.errors["admin_password"] = [msg] + form["admin_password"].errors = [msg] return render_template( "admin.html", form=form, @@ -183,7 +183,7 @@ def admin(): "This admin password is not the right one. Only %(num)d attempts left.", num=login_throttler.get_remaining_attempts(client_ip), ) - form.errors["admin_password"] = [msg] + form["admin_password"].errors = [msg] return render_template( "admin.html", form=form, @@ -210,7 +210,7 @@ def authenticate(project_id=None): # User doesn't provide project identifier or a valid token # return to authenticate form msg = _("You either provided a bad token or no project identifier.") - form.errors["id"] = [msg] + form["id"].errors = [msg] return render_template("authenticate.html", form=form) project = Project.query.get(project_id) @@ -246,7 +246,7 @@ def authenticate(project_id=None): return redirect(url_for(".list_bills")) if is_post_auth and not check_password_hash(project.password, form.password.data): msg = _("This private code is not the right one") - form.errors["password"] = [msg] + form["password"].errors = [msg] return render_template("authenticate.html", form=form) |
