mirror of
http://git.k-space.ee/arti/doors.git
synced 2024-11-12 15:30:59 +02:00
Add post "/info/<user_id>" endpoint to save new card key.
This commit is contained in:
parent
7fa907699d
commit
eb16e01f79
@ -138,6 +138,14 @@ def info(db, user_id):
|
|||||||
return {**user, "keycards": keycards}
|
return {**user, "keycards": keycards}
|
||||||
|
|
||||||
|
|
||||||
|
@app.post("/info/<user_id>")
|
||||||
|
def add_key_card(db, user_id):
|
||||||
|
card_name = request.forms.get("name")
|
||||||
|
card_uid = request.forms.get("uid")
|
||||||
|
db.add_keycard(user_id, card_uid, card_name)
|
||||||
|
redirect("/info/" + user_id)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/log")
|
@app.route("/log")
|
||||||
@view("log.html")
|
@view("log.html")
|
||||||
def log(db):
|
def log(db):
|
||||||
|
Loading…
Reference in New Issue
Block a user