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'