forked from rDrama/rDrama
...
parent
43f137208a
commit
ae0c215af3
|
@ -95,7 +95,7 @@ def get_account(id, v=None, graceful=False, include_blocks=False, include_shadow
|
||||||
|
|
||||||
user = g.db.get(User, id)
|
user = g.db.get(User, id)
|
||||||
|
|
||||||
if not user or (user.shadowbanned and not (include_shadowbanned or (v and (v.admin_level >= 2 or v.shadowbanned)))):
|
if not user or (user.shadowbanned and not (include_shadowbanned or (v and (v.admin_level >= PERMS['USER_SHADOWBAN'] or v.shadowbanned)))):
|
||||||
if not graceful: abort(404)
|
if not graceful: abort(404)
|
||||||
else: return None
|
else: return None
|
||||||
|
|
||||||
|
|
|
@ -1212,7 +1212,7 @@ def sticky_post(post_id, v):
|
||||||
if not post.stickied:
|
if not post.stickied:
|
||||||
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False).count()
|
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False).count()
|
||||||
if pins >= PIN_LIMIT:
|
if pins >= PIN_LIMIT:
|
||||||
if v.admin_level > 2:
|
if v.admin_level > PERMS['BYPASS_PIN_LIMIT']:
|
||||||
post.stickied = v.username
|
post.stickied = v.username
|
||||||
post.stickied_utc = int(time.time()) + 3600
|
post.stickied_utc = int(time.time()) + 3600
|
||||||
else: return {"error": f"Can't exceed {PIN_LIMIT} pinned posts limit!"}, 403
|
else: return {"error": f"Can't exceed {PIN_LIMIT} pinned posts limit!"}, 403
|
||||||
|
|
Loading…
Reference in New Issue