1
0
Fork 0
forked from bton/matekasse

test print

This commit is contained in:
2000-Trek 2023-06-23 20:55:26 +02:00
parent 5d8f04528f
commit 3aa1079868

View file

@ -51,7 +51,7 @@ def list():
users = c.fetchall() users = c.fetchall()
text = "" text = ""
for i in users: for i in users:
username = urllib.parse.quote_plus(i[1]) username = urllib.parse.quote_plus(i[1], safe='_.-~')
text = text + f'<p><a href="list/user?user={username}">{escape(i[1])}</a>: {i[2]} <form action="/change" method="get"><input name="id" type="hidden" value="{i[0]}"> Change balance: <input name="change"><input type="submit"></form></p> <br style="line-height: 50%;"></br>' text = text + f'<p><a href="list/user?user={username}">{escape(i[1])}</a>: {i[2]} <form action="/change" method="get"><input name="id" type="hidden" value="{i[0]}"> Change balance: <input name="change"><input type="submit"></form></p> <br style="line-height: 50%;"></br>'
return '''<!DOCTYPE html> return '''<!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -70,7 +70,7 @@ def list():
@app.route("/list/user", methods=['GET']) @app.route("/list/user", methods=['GET'])
def user_info(): def user_info():
username = urllib.parse.unquote_plus(request.args.get("user")) username = urllib.parse.unquote_plus(request.args.get("user"))
db_log.info(username) db_log.info(str(username))
c.execute("SELECT * FROM users WHERE username = ?", [username]) c.execute("SELECT * FROM users WHERE username = ?", [username])
user_list = c.fetchall() user_list = c.fetchall()
if user_list != []: if user_list != []: