This commit is contained in:
Aevann1 2021-10-21 16:47:27 +02:00
parent bcf7d8c456
commit 2cce840c39
61 changed files with 157 additions and 120 deletions

View file

@ -1064,19 +1064,6 @@ def api_sticky_post(post_id, v):
if post.stickied: return {"message": "Post pinned!"}
else: return {"message": "Post unpinned!"}
@app.post("/pin/<post_id>")
@auth_required
def api_pin_post(post_id, v):
post = g.db.query(Submission).options(lazyload('*')).filter_by(id=post_id).first()
if post:
post.is_pinned = not post.is_pinned
g.db.add(post)
g.db.commit()
if post.is_pinned: return {"message": "Post pinned!"}
else: return {"message": "Post unpinned!"}
@app.post("/ban_comment/<c_id>")
@limiter.limit("1/second")
@admin_level_required(1)