diff options
| -rw-r--r-- | apioforum/templates/common.html | 2 | ||||
| -rw-r--r-- | apioforum/thread.py | 3 |
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) |
