diff --git a/files/routes/holes.py b/files/routes/holes.py index 8f02fca5d..7f24c822c 100644 --- a/files/routes/holes.py +++ b/files/routes/holes.py @@ -416,40 +416,6 @@ def create_sub2(v): return redirect(f"/h/{hole}") -@app.post("/kick/") -@limiter.limit('1/second', scope=rpath) -@limiter.limit('1/second', scope=rpath, key_func=get_ID) -@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) -@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) -@auth_required -def kick(v, pid): - post = get_post(pid) - - if not post.hole: abort(403) - if not v.mods_hole(post.hole): abort(403) - - old = post.hole - post.hole = None - post.hole_pinned = None - - ma = HoleAction( - hole=old, - kind='kick_post', - user_id=v.id, - target_post_id=post.id - ) - g.db.add(ma) - - if v.id != post.author_id: - message = f"@{v.username} (a /h/{old} mod) has moved {post.textlink} from /h/{old} to the main feed!" - send_repeatable_notification(post.author_id, message) - - g.db.add(post) - - cache.delete_memoized(frontlist) - - return {"message": f"Post kicked from /h/{old} successfully!"} - @app.get('/h//settings') @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index 9f0de0572..a531a5bb0 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -83,12 +83,9 @@ {% endif %} - {% if v.mods_hole(p.hole) %} - - {% if not p.author.mods_hole(p.hole) %} - - - {% endif %} + {% if v.mods_hole(p.hole) and not p.author.mods_hole(p.hole) %} + + {% endif %} {% if (v.id == p.author_id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or v.mods_hole(p.hole)) %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index a51b071b6..7f575e658 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -71,8 +71,6 @@ - - {% if not p.author.mods_hole(p.hole) %}