don't duplicate checks for comments
parent
057bc360bf
commit
40c2360d00
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue