From 0b3fae81d6498cef58df7817055608451135a16c Mon Sep 17 00:00:00 2001 From: justcool393 Date: Thu, 3 Nov 2022 02:15:49 -0500 Subject: [PATCH] 's --- files/routes/posts.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 2135a86f5..ab09f7dd8 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1052,15 +1052,12 @@ def unsave_post(pid, v): @app.post("/pin/") @auth_required def pin_post(post_id, v): - post = get_post(post_id) if post: - if v.id != post.author_id: abort(400, "Only the post author's can do that!") + if v.id != post.author_id: abort(403, "Only the post author can do that!") post.is_pinned = not post.is_pinned g.db.add(post) - cache.delete_memoized(User.userpagelisting) - if post.is_pinned: return {"message": "Post pinned!"} else: return {"message": "Post unpinned!"} return abort(404, "Post not found!")