From 3b31c84972d566bc6de569e1df9e96cf7e239f23 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 25 Jun 2021 23:44:06 +0000 Subject: i will have this here too --- apioforum/templates/view_thread.html | 2 +- apioforum/thread.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html index 855f792..d45b36b 100644 --- a/apioforum/templates/view_thread.html +++ b/apioforum/templates/view_thread.html @@ -45,7 +45,7 @@ {% for opt in poll.options %}
- + {% endfor %} {% endif %} diff --git a/apioforum/thread.py b/apioforum/thread.py index 3dbc32d..3e03a67 100644 --- a/apioforum/thread.py +++ b/apioforum/thread.py @@ -46,6 +46,7 @@ def create_post(thread_id): db = get_db() content = request.form['content'] thread = db.execute("SELECT * FROM threads WHERE id = ?;",(thread_id,)).fetchone() + print(request.form.get('poll')) if len(content.strip()) == 0: flash("you cannot post an empty message") elif not thread: @@ -63,7 +64,8 @@ def create_post(thread_id): ) db.commit() flash("post posted postfully") - return redirect(post_jump(thread_id, post_id)) + return redirect(post_jump(thread_id, post_id)) + return redirect(url_for('thread.view_thread',thread_id=thread_id)) @bp.route("/delete_post/", methods=["GET","POST"]) def delete_post(post_id): -- cgit v1.2.3