From 787367195431ac9a2c30106c193582b1b9a1ff99 Mon Sep 17 00:00:00 2001 From: raven Date: Mon, 2 Nov 2026 02:24:07 -0600 Subject: don't obliterate form contents if create thread errors --- apioforum/forum.py | 6 +++++- apioforum/templates/config_thread.html | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apioforum/forum.py b/apioforum/forum.py index b731a24..425d148 100644 --- a/apioforum/forum.py +++ b/apioforum/forum.py @@ -292,7 +292,9 @@ def create_thread(forum): if g.user is None: flash("you need to be logged in to create a " + thread_type) return redirect(url_for('index')) - + + title = request.args['title'] if 'title' in request.args else "" + content = request.args['content'] if 'content' in request.args else "" if request.method == "POST": title = request.form['title'] content = request.form['content'] @@ -336,6 +338,8 @@ def create_thread(forum): return render_template("config_thread.html", forum=forum, thread_type=thread_type, + title=title, + content=content, avail_tags=get_avail_tags(forum['id'])) @forum_route("roles",methods=("GET","POST")) diff --git a/apioforum/templates/config_thread.html b/apioforum/templates/config_thread.html index a97e8e6..6d4b7f2 100644 --- a/apioforum/templates/config_thread.html +++ b/apioforum/templates/config_thread.html @@ -17,11 +17,11 @@
{{type}} - + {% if not thread %}
- + {% endif %}
-- cgit v1.2.3