From 35cfedbb2e3dc712de56440efbdcf22c9b1be36b Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Wed, 21 Jun 2023 21:10:09 +0200 Subject: [PATCH] api fix --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 39f391c..ecb44e1 100644 --- a/main.py +++ b/main.py @@ -187,7 +187,7 @@ def request_addtag(data): finished = None c.execute(f"SELECT * FROM users WHERE id ={user[0]}") username = c.fetchall()[0][1] - if message == "Tag already exists": + if message == "Error: 170": socketio.emit("finished", f"{message}") else: socketio.emit("finished", f"Added {message} to {username}", to=session[id]) @@ -265,7 +265,7 @@ def get_id(): message = tag_id finished = queue_item c.execute(f"SELECT * FROM users WHERE id={user}") - username = c.fetchall()[0] + username = c.fetchall()[0][1] conn.commit() return make_response(json.dumps({"mode":"2","username":username,"code":"1"})) elif state == "remove": @@ -276,7 +276,7 @@ def get_id(): message = tag_id finished = queue_item c.execute(f"SELECT * FROM users WHERE id={user}") - username = c.fetchall()[0] + username = c.fetchall()[0][1] conn.commit() return make_response(json({"mode":"2","username":username,"code":"2"})) else: