flask 0.11 compatibility

This commit is contained in:
Stephane Martin 2016-09-05 23:19:28 +02:00
parent 328f41b85c
commit 9ac015b3dd
5 changed files with 13 additions and 13 deletions

View file

@ -12,7 +12,7 @@ blueprint = Blueprint('auth', __name__, template_folder='templates')
@blueprint.route("/login", methods=['GET', 'POST'])
def login():
next_url = request.args.get('next') or url_for(current_app.config['ROOT_ENDPOINT'])
if current_user.is_authenticated():
if current_user.is_authenticated:
return redirect(next_url)
session['next_url'] = next_url
return render_template("auth/login.html", forms=Auth.login_forms())