penis
This commit is contained in:
parent
9145ede016
commit
3df799a491
1 changed files with 6 additions and 5 deletions
11
main.py
11
main.py
|
@ -7,7 +7,7 @@ import atexit
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
db_path = 'mate.db'
|
db_path = 'mate.db'
|
||||||
conn = sqlite3.connect(db_path)
|
conn = sqlite3.connect(db_path, check_same_thread=False)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
@ -54,13 +54,13 @@ def new_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(f"SELECT * FROM users WHERE username='{str(user)}'")
|
c.execute(f"SELECT * FROM users WHERE username='{str(user)}'")
|
||||||
if c.fetchall() == []:
|
if c.fetchall() == []:
|
||||||
c.execute("INSERT or IGNORE INTO users (username, balance) VALUES ('%s', 0)" % user)
|
c.execute("INSERT or IGNORE INTO users (username, balance) VALUES ('%s', 0)" % user)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
return "alert('Added userd')"
|
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 "alert('User already exists')"
|
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>'
|
||||||
|
|
||||||
|
|
||||||
@app.route("/change", methods=['GET'])
|
@app.route("/change", methods=['GET'])
|
||||||
|
@ -142,4 +142,5 @@ def get_id():
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
atexit.register(exit_handler)
|
atexit.register(exit_handler)
|
||||||
socketio.run(app)
|
socketio.run(app, host='0.0.0.0', port=5000)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue