Shunlnd do anything (that is right inglish)
This commit is contained in:
parent
0ecb7bb648
commit
bc42e46e8c
1 changed files with 4 additions and 4 deletions
8
main.py
8
main.py
|
@ -59,7 +59,7 @@ def list():
|
||||||
@app.route("/list/user", methods=['GET'])
|
@app.route("/list/user", methods=['GET'])
|
||||||
def user_info():
|
def user_info():
|
||||||
username = request.args.get("user")
|
username = request.args.get("user")
|
||||||
c.execute("SELECT * FROM users WHERE username = %(username)s", {'username':username})
|
c.execute("SELECT * FROM users WHERE username = %(username)s", {'username': username})
|
||||||
user_list = c.fetchall()
|
user_list = c.fetchall()
|
||||||
if user_list != []:
|
if user_list != []:
|
||||||
user = user_list[0]
|
user = user_list[0]
|
||||||
|
@ -112,13 +112,13 @@ 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("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()
|
||||||
return 'Added user <a href="/list">user and tag list</a> <p>The creator of this website accepts no liability for any linguistic or technical errors!</p>'
|
return 'Added user <a href="/list">user and tag list</a> <p>The creator of this website accepts no liability for any linguistic or technical errors!</p>'
|
||||||
else:
|
else:
|
||||||
return 'User already exists <a href="/list">user and tag list</a> <p>The creator of this website accepts no liability for any linguistic or technical errors!</p>'
|
return '<p>User already exists</p> <a href="/list">user and tag list</a>'
|
||||||
|
|
||||||
|
|
||||||
@app.route("/change", methods=['GET'])
|
@app.route("/change", methods=['GET'])
|
||||||
|
|
Loading…
Reference in a new issue