@bp.route("/create_account", methods=["POST"])
def create_account() -> None:
if request.method == "POST":
username: str = request.args.get("username")
password: str = request.args.get("password")
db = get_db()
user_id: str = str(uuid4())
acc_data: tuple = (user_id, username, hash_p(password))
db.execute("INSERT INTO Acc_Data (acc_id, username, h_pass) VALUES (?, ?, ?)", acc_data)
db.commit()
This is my view function and it works but then flask raises a type error raise TypeError( r returned None or ended without a return statement. TypeError: The view function for 'auth.create_account' did not return a valid response. The function either returned None or ended without a return statement.
Why does it have to return something if its a post request?