fg
This commit is contained in:
parent
7b4d3a7b8f
commit
043b822b3e
2 changed files with 17 additions and 12 deletions
|
@ -145,9 +145,10 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
||||||
def api_comment(v):
|
def api_comment(v):
|
||||||
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
||||||
|
|
||||||
|
if v.admin_level < 2:
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
|
||||||
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
|
||||||
|
|
||||||
parent_submission = request.values.get("submission").strip()
|
parent_submission = request.values.get("submission").strip()
|
||||||
parent_fullname = request.values.get("parent_fullname").strip()
|
parent_fullname = request.values.get("parent_fullname").strip()
|
||||||
|
@ -693,9 +694,11 @@ def api_comment(v):
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def edit_comment(cid, v):
|
def edit_comment(cid, v):
|
||||||
|
|
||||||
|
if v.admin_level < 2:
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
|
||||||
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
|
||||||
|
|
||||||
c = get_comment(cid, v=v)
|
c = get_comment(cid, v=v)
|
||||||
|
|
||||||
|
|
|
@ -444,9 +444,10 @@ def morecomments(v, cid):
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def edit_post(pid, v):
|
def edit_post(pid, v):
|
||||||
|
if v.admin_level < 2:
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
|
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
|
||||||
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}, 413
|
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB (8 MB for paypigs)."}, 413
|
||||||
|
|
||||||
p = get_post(pid)
|
p = get_post(pid)
|
||||||
|
|
||||||
|
@ -875,9 +876,10 @@ def submit_post(v, sub=None):
|
||||||
|
|
||||||
if v.is_suspended: return error("You can't perform this action while banned.")
|
if v.is_suspended: return error("You can't perform this action while banned.")
|
||||||
|
|
||||||
|
if v.admin_level < 2:
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
if request.content_length > 8 * 1024 * 1024: return error( "Max file size is 8 MB.")
|
if request.content_length > 8 * 1024 * 1024: return error( "Max file size is 4 MB (8 MB for paypigs).")
|
||||||
elif request.content_length > 4 * 1024 * 1024: return error( "Max file size is 4 MB.")
|
elif request.content_length > 4 * 1024 * 1024: return error( "Max file size is 4 MB (8 MB for paypigs).")
|
||||||
|
|
||||||
if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username)
|
if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue