1
0
Fork 0
forked from bton/matekasse
This commit is contained in:
2000-Trek 2023-06-14 22:21:00 +02:00
parent af46c418e1
commit 2f32a8a4cb

View file

@ -112,7 +112,7 @@ def remove_user():
@app.route("/adduser/user", methods=['GET']) @app.route("/adduser/user", methods=['GET'])
def adduser(): def adduser():
user = request.args.get("username") user = request.args.get("username")
c.execute(f"SELECT * FROM users WHERE username=%(user)s", {'user' : user}) c.execute("SELECT * FROM users WHERE username=%(user)s", {'user' : user})
if c.fetchall() == []: if c.fetchall() == []:
c.execute("INSERT or IGNORE INTO users (username, balance) VALUES ('%(user)s', 0)", {'user' : user} ) c.execute("INSERT or IGNORE INTO users (username, balance) VALUES ('%(user)s', 0)", {'user' : user} )
conn.commit() conn.commit()