From d6c73dbde8a35905a8f29caf9b6d088043a5e78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marjo=20Murtom=C3=A4ki?= Date: Mon, 27 Nov 2023 20:06:59 +0200 Subject: Fixing so that the code will run again after adding csrf checks. --- routes/tools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'routes/tools.py') diff --git a/routes/tools.py b/routes/tools.py index eea6a8f..3f831a9 100644 --- a/routes/tools.py +++ b/routes/tools.py @@ -38,9 +38,9 @@ def generate_link(): str+=vocal[randint(0,len(vocal)-1)] return str -def csrf_check( redir ) - if "csrf" not in session - or "csrf" not in request.form - of session["csrf"]!=request.form["csrf"]: +def csrf_check( redir ): + if "csrf" not in session \ + or "csrf" not in request.form \ + or session["csrf"]!=request.form["csrf"]: session["alert"]="Istuntosi katkesi tai pyyntö toiselta sivulta!" return redirect( redir ) -- cgit v1.2.3