From 9a832511ae2c48b64896ca1e6d5a80c690de0d78 Mon Sep 17 00:00:00 2001 From: Daniel Maclaren Date: Sun, 24 Mar 2024 22:04:17 +0000 Subject: [PATCH] usuername is taken in as a tuple, added a comma to prevent this --- app.py | 4 ++-- templates/login.html | 4 ++-- templates/register.html | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index c9346a2..7e39de6 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,4 @@ -from flask import Flask, render_template, request, session +from flask import Flask, render_template, request, session, redirect from helpers import login_required from werkzeug.security import check_password_hash, generate_password_hash import sqlite3 @@ -35,7 +35,7 @@ def register(): return apology("passwords must match", 400) rows = db.execute( - "SELECT * FROM users WHERE username = ?", request.form.get("username") + "SELECT * FROM users WHERE username = ?", (request.form.get("username"),) ) if len(rows) >= 1: diff --git a/templates/login.html b/templates/login.html index 8f69d03..87b17af 100644 --- a/templates/login.html +++ b/templates/login.html @@ -8,11 +8,11 @@
- +
- +
diff --git a/templates/register.html b/templates/register.html index 1bd5051..6912685 100644 --- a/templates/register.html +++ b/templates/register.html @@ -7,15 +7,15 @@ {% block main %}
- +
- +
- +