rewrite routing to list

This commit is contained in:
2022-04-06 14:32:09 +02:00
parent d84027ac14
commit 10160bceed
3 changed files with 13 additions and 9 deletions
+6 -5
View File
@@ -26,16 +26,17 @@ def login():
auth_user_id = db.user_cred.find_one({"username": username},{"uuid": 1})
if auth_user_id:
app.logger.info(auth_user_id)
return render_template("welcome.html", id=auth_user_id["uuid"])
return redirect(url_for("list", id=auth_user_id["uuid"]))
#return render_template("list.html", username=username)
else:
return render_template("404.html")
return redirect(url_for("not_found"))
else:
error = "Usernaam of wachtwoord onbekend, probeer opnieuw"
return render_template("login.html", error=error)
@app.route("/welcome/<id>", methods=['GET'])
def welcome(id):
print("Hello: ", id)
@app.route("/list/<id>", methods=['GET'])
def list(id):
return render_template("list.html", id=id)
@app.errorhandler(404)
def not_found(error):