1
0
Fork 0
forked from bton/matekasse

Added log for add user

This commit is contained in:
2000-Trek 2023-06-23 19:15:12 +02:00
parent df320bea8b
commit 3dcc985087

View file

@ -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 <a href="/list">user and tag list</a>'
else:
return '<p>Error: 170</p> <a href="/list">user and tag list</a>'