test print
This commit is contained in:
parent
5d8f04528f
commit
3aa1079868
1 changed files with 2 additions and 2 deletions
4
main.py
4
main.py
|
@ -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 != []:
|
||||||
|
|
Loading…
Reference in a new issue