From 7590ec09c6850f6e5f7b2abc525d3297388a7426 Mon Sep 17 00:00:00 2001 From: flifloo Date: Tue, 21 May 2019 20:51:59 +0200 Subject: [PATCH] Fix some shit --- app/routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes.py b/app/routes.py index 171d545..8909dcb 100644 --- a/app/routes.py +++ b/app/routes.py @@ -118,7 +118,7 @@ def dashboard(): db.session.delete(t) db.session.commit() if request.args.get("delet"): - twapi.destroy_status(request.args.get["twrm"]) + twapi.destroy_status(request.args.get("twrm")) return redirect(url_for("dashboard")) elif "tweet" in request.form and "slots" in request.form and "keywords" in request.form: try: @@ -129,7 +129,7 @@ def dashboard(): else: db.session.add(Tweets(user = current_user, statu_id = tweet, slots = 0, slots_max = slots, keywords = str(request.form["keywords"].split(",")))) db.session.commit() - if str(subprocess.check_output(["screen", "-list"])).find(f"stream-{str(current_user.id)}") == -1: + if str(subprocess.check_output(["screen -list; exit 0"], stderr=subprocess.STDOUT, shell=True)).find(f"stream-{str(current_user.id)}") == -1: subprocess.check_call(["screen", "-S", f"stream-{str(current_user.id)}", "-d", "-m", "python3.7", "stream.py", str(current_user.id)], cwd = basedir) return redirect(url_for("dashboard"))