From 3dcc985087e51495f0cd04827095f0f986613ffa Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Fri, 23 Jun 2023 19:15:12 +0200 Subject: [PATCH] Added log for add user --- main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index f0cef3e..98039cd 100644 --- a/main.py +++ b/main.py @@ -123,12 +123,15 @@ def remove_user(): @app.route("/adduser/user", methods=['GET']) def adduser(): - user = request.args.get("username") - c.execute("SELECT * FROM users WHERE username=?", [user]) + username = request.args.get("username") + c.execute("SELECT * FROM users WHERE username=?", [username]) if c.fetchall() == []: - c.execute("INSERT or IGNORE INTO users (username, balance) VALUES (?, 0)", [user]) + c.execute("INSERT or IGNORE INTO users (username, balance) VALUES (?, 0)", [username]) conn.commit() socketio.emit("update", "update") + c.execute(f"SELECT * FROM users WHERE username={username}") + user = c.fetchall()[0] + db_log(f"Added user id: {user[0]} name: {user[2]}") return 'Added user user and tag list' else: return '

Error: 170

user and tag list'