add /h/announcements

pull/232/head
Aevann 2024-08-03 22:17:45 +03:00
parent fafafe504c
commit 13d19a8aca
2 changed files with 4 additions and 0 deletions

View File

@ -236,6 +236,7 @@ PERMS = { # Minimum admin_level to perform action.
'USER_LINK': 4,
'ADMIN_ADD': 4,
'ADMIN_REMOVE': 4,
'POST_IN_H_ANNOUNCEMENTS': 4,
'MODS_EVERY_HOLE': 5,
'MODS_EVERY_GROUP': 5,

View File

@ -499,6 +499,9 @@ def submit_post(v, hole=None):
if hole == 'changelog':
abort(400, "/h/changelog is archived")
if hole == 'announcements' and v.admin_level < PERMS["POST_IN_H_ANNOUNCEMENTS"]:
abort(400, "Your admin level isn't high enough to post in /h/announcement")
if hole in {'furry','vampire','racist','femboy','edgy'} and not v.client and not v.house.lower().startswith(hole):
abort(400, f"You need to be a member of House {hole.capitalize()} to post in /h/{hole}")