don't duplicate checks for comments

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-09-30 15:43:36 -07:00
parent 057bc360bf
commit 40c2360d00
3 changed files with 0 additions and 10 deletions

View File

@ -1318,10 +1318,7 @@ def unsticky_comment(cid, v):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2)
def remove_comment(c_id, v):
comment = get_comment(c_id)
if not comment:
abort(404)
comment.is_banned = True
comment.is_approved = None

View File

@ -48,9 +48,6 @@ def exile_post(v, pid):
@is_not_permabanned
def exile_comment(v, cid):
if v.shadowbanned: return {"error": "Internal Server Error"}, 500
try: cid = int(cid)
except: abort(400)
c = get_comment(cid)
sub = c.post.sub
if not sub: abort(400)

View File

@ -133,10 +133,6 @@ def vote_comment(comment_id, new, v):
if request.headers.get("Authorization") and v.id != BBBB_ID: abort(403)
new = int(new)
try: comment_id = int(comment_id)
except: abort(404)
comment = get_comment(comment_id)
coin_delta = 1