diff --git a/main.py b/main.py index 427e0b1..562e349 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,7 @@ import atexit import sys db_path = 'mate.db' -conn = sqlite3.connect(db_path) +conn = sqlite3.connect(db_path, check_same_thread=False) c = conn.cursor() app = Flask(__name__) @@ -54,13 +54,13 @@ def new_user(): @app.route("/adduser/user", methods=['GET']) def adduser(): 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() == []: c.execute("INSERT or IGNORE INTO users (username, balance) VALUES ('%s', 0)" % user) conn.commit() - return "alert('Added userd')" + return 'Added user user and tag list
The creator of this website accepts no liability for any linguistic or technical errors!
' else: - return "alert('User already exists')" + return 'User already exists user and tag listThe creator of this website accepts no liability for any linguistic or technical errors!
' @app.route("/change", methods=['GET']) @@ -142,4 +142,5 @@ def get_id(): def main(): atexit.register(exit_handler) - socketio.run(app) + socketio.run(app, host='0.0.0.0', port=5000) +