replace stub returns with redirects

This commit is contained in:
2025-07-04 17:24:17 +03:00
parent 13c89cbde2
commit 7ab1c8745f
3 changed files with 40 additions and 30 deletions

View File

@@ -51,7 +51,7 @@ def topic(slug):
"slug": slug
})
if not target_topic:
return "no"
return redirect(url_for('.all_topics'))
threads_count = Threads.count({
"topic_id": target_topic.id
@@ -77,7 +77,7 @@ def topic(slug):
def edit(slug):
topic = Topics.find({"slug": slug})
if not topic:
return "no"
return redirect(url_for('.all_topics'))
return render_template("topics/edit.html", topic=topic)
@@ -87,7 +87,7 @@ def edit(slug):
def edit_post(slug):
topic = Topics.find({"slug": slug})
if not topic:
return "no"
return redirect(url_for('.all_topics'))
topic.update({
"name": request.form.get('name', default = topic.name).strip(),
@@ -104,7 +104,7 @@ def edit_post(slug):
def delete(slug):
topic = Topics.find({"slug": slug})
if not topic:
return "no"
return redirect(url_for('.all_topics'))
topic.delete()