From 9333df3b7fece97cc4df1f4bd50f95a2f924563c Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Tue, 15 Oct 2013 22:30:45 +0200 Subject: Support flashing --- app/views/__init__.py | 3 ++- app/views/login.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/__init__.py b/app/views/__init__.py index 58d9fb6..275a6c9 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -9,12 +9,13 @@ from .. import app, db from ..login import current_user, login_required from ..utils import templated, redirect from ..flask_extend import Blueprint +from flask import flash __all__ = [ "db", "app", "current_user", "login_required", "templated", "redirect", - "Blueprint", + "Blueprint", "flash", "request", "url_for" ] diff --git a/app/views/login.py b/app/views/login.py index 4b327ec..413d406 100644 --- a/app/views/login.py +++ b/app/views/login.py @@ -1,4 +1,4 @@ -from . import Blueprint, db, \ +from . import Blueprint, flash, db, \ current_user, login_required, \ templated, request, url_for @@ -18,6 +18,8 @@ def login(): if form.validate_on_submit(): login_user(form.user) return redirect(request.args.get("next") or url_for("index")) + elif form.is_submitted(): + flash("Login fehlgeschlagen!", "error") return { 'form': form } -- cgit v1.2.3-70-g09d2