add house holes
parent
fb2437574f
commit
b5d500a98e
|
@ -151,6 +151,9 @@ def comment(v):
|
|||
sub = parent_post.sub
|
||||
if sub and v.exiled_from(sub): return {"error": f"You're exiled from /h/{sub}"}, 403
|
||||
|
||||
if sub in ('furry','vampire','racist','femboy') and not (v.house and v.house.lower().startswith(sub)):
|
||||
return {"error": f"You need to be a member of House {sub.capitalize()} to comment in /h/{sub}"}
|
||||
|
||||
if parent_post.club and not (v and (v.paid_dues or v.id == parent_post.author_id)): abort(403)
|
||||
|
||||
rts = False
|
||||
|
|
|
@ -700,6 +700,9 @@ def submit_post(v, sub=None):
|
|||
allowed = [x[0] for x in allowed]
|
||||
if v.id not in allowed: return error(f"You don't have sufficient permissions to post in /h/changelog")
|
||||
|
||||
if sub in ('furry','vampire','racist','femboy') and not (v.house and v.house.lower().startswith(sub)):
|
||||
return error(f"You need to be a member of House {sub.capitalize()} to post in /h/{sub}")
|
||||
|
||||
if sub and sub != 'none':
|
||||
sname = sub.strip().lower()
|
||||
sub = g.db.query(Sub.name).filter_by(name=sname).one_or_none()
|
||||
|
|
|
@ -49,6 +49,12 @@ def flag_post(pid, v):
|
|||
if post.author.exiled_from(sub_to):
|
||||
return {"error": f"User is exiled from this {HOLE_NAME}!"}
|
||||
|
||||
if sub_to in ('furry','vampire','racist','femboy') and not (post.author.house and post.author.house.lower().startswith(sub_to)):
|
||||
if v.id == post.author_id:
|
||||
return {"error": f"You need to be a member of House {sub.capitalize()} to post in /h/{sub}"}
|
||||
else:
|
||||
return {"error": f"@{post.author.username} needs to be a member of House {sub.capitalize()} for their post to be moved to /h/{sub}"}
|
||||
|
||||
post.sub = sub_to
|
||||
g.db.add(post)
|
||||
|
||||
|
|
Loading…
Reference in New Issue