forked from bton/matekasse
Debuging print sachen
This commit is contained in:
parent
3c947da209
commit
4f50c13543
1 changed files with 6 additions and 1 deletions
7
main.py
7
main.py
|
@ -96,7 +96,6 @@ def request_addtag(data):
|
|||
global finished
|
||||
if len(users.queue) > 0:
|
||||
user = users.queue[len(users.queue) - 1]
|
||||
print(user)
|
||||
if user == data["data"]:
|
||||
socketio.emit("wait", "wait")
|
||||
i = 0
|
||||
|
@ -123,21 +122,27 @@ def request_addtag(data):
|
|||
def get_id():
|
||||
global finished
|
||||
tag_id = int(request.args.get("id"))
|
||||
print(tag_id)
|
||||
c.execute(f"SELECT * FROM tags WHERE tagid ={tag_id}")
|
||||
tag_list = c.fetchall()
|
||||
print(tag_list)
|
||||
if tag_list != []:
|
||||
tag = tag_list[0]
|
||||
if users.qsize() == 0:
|
||||
c.execute(f"UPDATE users SET balance = balance - 1 WHERE id={tag[1]}")
|
||||
print("changed")
|
||||
conn.commit()
|
||||
return make_response("True")
|
||||
|
||||
elif users.qsize() > 0:
|
||||
print("added")
|
||||
user = users.get()
|
||||
c.execute(f"INSERT OR IGNORE INTO tags (tagid, userid) VALUES ({tag_id}, {user})")
|
||||
conn.commit()
|
||||
finished = user
|
||||
return make_response("True")
|
||||
else:
|
||||
print("Error")
|
||||
|
||||
return make_response("False")
|
||||
|
||||
|
|
Loading…
Reference in a new issue