forked from MarseyWorld/MarseyWorld
Make PIN_LIMIT a per-site constant.
parent
6b9a133204
commit
379ae664a3
|
@ -128,6 +128,8 @@ AGENDAPOSTER_PHRASE = 'trans lives matter'
|
|||
|
||||
AGENDAPOSTER_MSG = """Hi @{username},\n\nYour {type} has been automatically removed because you forgot to include `{AGENDAPOSTER_PHRASE}`.\n\nDon't worry, we're here to help! We won't let you post or comment anything that doesn't express your love and acceptance towards the trans community. Feel free to resubmit your {type} with `{AGENDAPOSTER_PHRASE}` included. \n\n*This is an automated message; if you need help, you can message us [here](/contact).*"""
|
||||
|
||||
PIN_LIMIT = 3
|
||||
|
||||
if SITE in {'rdrama.net','devrama.xyz'}:
|
||||
HOLE_COST = 200000
|
||||
NOTIFICATIONS_ID = 1046
|
||||
|
@ -176,6 +178,7 @@ if SITE in {'rdrama.net','devrama.xyz'}:
|
|||
|
||||
elif SITE == "pcmemes.net":
|
||||
HOLE_COST = 10000
|
||||
PIN_LIMIT = 6
|
||||
NOTIFICATIONS_ID = 1046
|
||||
AUTOJANNY_ID = 1050
|
||||
SNAPPY_ID = 261
|
||||
|
|
|
@ -1356,11 +1356,11 @@ def sticky_post(post_id, v):
|
|||
post = g.db.query(Submission).filter_by(id=post_id).one_or_none()
|
||||
if post and not post.stickied:
|
||||
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False).count()
|
||||
if pins > 2:
|
||||
if pins >= PIN_LIMIT:
|
||||
if v.admin_level > 2:
|
||||
post.stickied = v.username
|
||||
post.stickied_utc = int(time.time()) + 3600
|
||||
else: return {"error": "Can't exceed 3 pinned posts limit!"}, 403
|
||||
else: return {"error": f"Can't exceed {PIN_LIMIT} pinned posts limit!"}, 403
|
||||
else: post.stickied = v.username
|
||||
g.db.add(post)
|
||||
|
||||
|
|
Loading…
Reference in New Issue