From e01f5c44f08bdb0a1c24109ce95becf8e3bfa165 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 7 May 2023 10:22:21 +0200 Subject: fix: [forms] Fixed an issue in Flask-WTF. --- newspipe/web/views/session_mgmt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/newspipe/web/views/session_mgmt.py b/newspipe/web/views/session_mgmt.py index 6aad5833..0e8329e5 100644 --- a/newspipe/web/views/session_mgmt.py +++ b/newspipe/web/views/session_mgmt.py @@ -4,6 +4,7 @@ from datetime import datetime from flask import current_app from flask import flash from flask import redirect +from flask import request from flask import render_template from flask import session from flask import url_for @@ -79,7 +80,8 @@ def login(): if current_user.is_authenticated: return redirect(url_for("home")) form = SigninForm() - if form.validate_on_submit(): + # if form.validate_on_submit(): + if request.method == "POST" and form.validate(): # fixes an issue in flask-wtf login_user_bundle(form.user) return form.redirect("home") return render_template("login.html", form=form) -- cgit