From 2ca3c4c71ca9d23b810c9f05b375c145195cbc1e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 29 Apr 2022 21:19:54 +0200 Subject: [PATCH] dfs --- files/routes/posts.py | 1 + files/templates/post_actions.html | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 857059662..b5e60f621 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -43,6 +43,7 @@ titleheaders = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWe def toggle_club(pid, v): post = get_post(pid) + if post.author_id != v.id and v.admin_level < 2: abort(403) post.club = not post.club g.db.add(post) diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index b45b6649a..806a6ec2d 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -50,8 +50,10 @@ Unpin {% endif %} - Mark club - Unmark club + {% if v.admin_level > 1 or v.id == p.author_id %} + Mark club + Unmark club + {% endif %} {% if v.admin_level > 1 %} {% if "/reported/" in request.path %}