From 8e0d596a314830cdc1beff985b82ceac5a726d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Thu, 8 Jun 2023 00:49:15 +0200 Subject: [PATCH] Change flash messages with categories --- app/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index bef7f48..9185dd1 100644 --- a/app/main.py +++ b/app/main.py @@ -46,7 +46,7 @@ def set_benchmark(benchmark_id): if current_user.admin: benchmark = Benchmark.query.filter_by(id=benchmark_id).first() if benchmark is None: - flash("Benchmark not found.") + flash("Benchmark not found.", "danger") return redirect(url_for(INDEX)) current_user.benchmark = benchmark db.session.commit() @@ -71,7 +71,7 @@ def login(): if form.validate_on_submit(): user = User.query.filter_by(username=form.username.data).first() if user is None or not user.check_password(form.password.data): - flash("Invalid username or password") + flash("Invalid username or password", "danger") return redirect(url_for("main.login")) login_user(user, remember=form.remember_me.data) flash("Logged in successfully.")