Skip to content

Commit 97adf50

Browse files
committed
Flash form validate_on_submit errors
1 parent 772cb4c commit 97adf50

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/db_auth.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ def login(self):
236236
form.password.errors.append(login_fail_reason)
237237
# Maybe different message when
238238
# user.failed_sign_in_count >= MAX_LOGIN_ATTEMPTS
239+
else:
240+
errors = [f"{key}: {val}" for key, values in form.errors.items() for val in values]
241+
for error in errors:
242+
flash(error)
239243

240244
return render_template('login.html', form=form, i18n=i18n,
241245
title=i18n.t("auth.login_page_title"),

0 commit comments

Comments
 (0)