summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorubq323 <ubq323>2021-06-25 23:44:06 +0000
committerubq323 <ubq323>2021-06-25 23:44:06 +0000
commit3b31c84972d566bc6de569e1df9e96cf7e239f23 (patch)
tree18c490f9af16e79929f388c7e6e07561e9d0e6ca
parentfb3c1f07d6488cfe91f3a5232224ff82e53ec339 (diff)
i will have this here too
-rw-r--r--apioforum/templates/view_thread.html2
-rw-r--r--apioforum/thread.py4
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 %}
<br>
<input type="radio" id="option_{{opt.option_idx}}" name="poll" value="{{opt.option_idx}}">
- <label for="option_{{opt.option_idx}}">#{{opt.option_idx}} - {{opt.text}}</label>
+ <label for="option_{{opt.option_idx}}">submit a vote for #{{opt.option_idx}} - {{opt.text}}</label>
{% endfor %}
</fieldset>
{% 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/<int:post_id>", methods=["GET","POST"])
def delete_post(post_id):