From 28300ee889f74eaf29fec5dc0bb2f4492375b0d2 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Mon, 28 Jun 2021 04:12:29 -0700 Subject: [PATCH] bugfix: populate context on invalid password (account edit) Signed-off-by: Kevin Morris --- aurweb/routers/accounts.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aurweb/routers/accounts.py b/aurweb/routers/accounts.py index 36871595..5d798ae8 100644 --- a/aurweb/routers/accounts.py +++ b/aurweb/routers/accounts.py @@ -483,15 +483,15 @@ async def account_edit_post(request: Request, context = await make_variable_context(request, "Accounts") context["user"] = user + args = dict(await request.form()) + context = make_account_form_context(context, request, user, args) + ok, errors = process_account_form(request, user, args) + if not passwd: context["errors"] = ["Invalid password."] return render_template(request, "account/edit.html", context, status_code=int(HTTPStatus.BAD_REQUEST)) - args = dict(await request.form()) - context = make_account_form_context(context, request, user, args) - ok, errors = process_account_form(request, user, args) - if not ok: context["errors"] = errors return render_template(request, "account/edit.html", context,