aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorraven <citrons@mondecitronne.com>2026-11-02 04:14:52 -0600
committerraven <citrons@mondecitronne.com>2026-11-02 04:14:52 -0600
commit0c6e3fd120bd3b66bf71710711019a09c30bdd93 (patch)
tree52236bc260a8294ae8d018b1f61c9b9f5027a7c2
parentd0208955787316b586cdafd0e81bb56358f5d326 (diff)
prevent deleting the wiki body, which is problematic
-rw-r--r--apioforum/templates/common.html2
-rw-r--r--apioforum/thread.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html
index be7b6ee..c731180 100644
--- a/apioforum/templates/common.html
+++ b/apioforum/templates/common.html
@@ -44,7 +44,7 @@
<a class="actionbutton"
href="{{url_for('thread.edit_post',post_id=post.id)}}">edit</a>
{% endif %}
- {% if post.author == g.user or (forum and has_permission(forum, g.user, "p_delete_posts")) %}
+ {% if post.wiki != 1 and (post.author == g.user or (forum and has_permission(forum, g.user, "p_delete_posts"))) %}
<a class="actionbutton"
href="{{url_for('thread.delete_post',post_id=post.id)}}">delete</a>
{% endif %}
diff --git a/apioforum/thread.py b/apioforum/thread.py
index 9b74347..b679b2a 100644
--- a/apioforum/thread.py
+++ b/apioforum/thread.py
@@ -310,6 +310,9 @@ def delete_post(post_id):
return redirect("/")
jump_url = post_jump(post_id)
+ if post['wiki'] == 1:
+ flash("cannot delete wiki post")
+ return redirect(jump_url)
if post['author'] != g.user and not has_permission(thread['forum'], g.user, "p_delete_posts"):
flash("you do not have permission to do that")
return redirect(jump_url)