diff options
author | Andrew Yu <andrew@andrewyu.org> | 2023-01-29 13:55:17 +0100 |
---|---|---|
committer | Andrew Yu <andrew@andrewyu.org> | 2023-01-29 13:55:17 +0100 |
commit | af86f84d1634573d662953619fcd9d4495a74c0f (patch) | |
tree | 8a32b2c0147ff4f259f10e1cf28408b2c8944b1d | |
parent | fe9e7573900a191c48135b5eec18dc3408e77fcc (diff) | |
download | qbox-af86f84d1634573d662953619fcd9d4495a74c0f.tar.gz qbox-af86f84d1634573d662953619fcd9d4495a74c0f.zip |
Pretty-print database output
-rw-r--r-- | app.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -41,7 +41,7 @@ app = Flask(__name__) def append_question(text, ts): db.append({"q": text, "a": None, "ts": ts}) with open("db.json", "w") as db_file: - json.dump(db, db_file) + json.dump(db, db_file, indent=4) def gpq(): gd = "" @@ -71,6 +71,7 @@ def index(): if "text" in request.form and request.form["text"].strip(): text = request.form["text"] append_question(text, ts) + print(text + "\a") else: return Response("Empty submissions are forbidden.", mimetype='text/plain') return Response("Submission successful.", mimetype='text/plain') |