Revert "fix distinguish no longer appearing in mod log for JL4 on WPD"

This reverts commit ad85c74c54.
master
Aevann 2024-08-03 20:07:17 +03:00
parent 63f944b981
commit e298fde98a
3 changed files with 17 additions and 42 deletions

View File

@ -466,7 +466,7 @@ class User(Base):
if not hole: return False
if self.is_permabanned or self.shadowbanned: return False
if hole == 'test'and self.truescore >= TRUESCORE_MINIMUM: return True
if self.admin_level >= PERMS['MODS_EVERY_HOLE']: return True
try:
return any(map(lambda x: x.hole == hole, self.hole_mods))
except:
@ -527,6 +527,8 @@ class User(Base):
@lazy
def mod_date(self, hole):
if self.admin_level >= PERMS['MODS_EVERY_HOLE']: return 1
mod_ts = g.db.query(Mod.created_utc).filter_by(user_id=self.id, hole=hole).one_or_none()
if mod_ts is None:
return None

View File

@ -236,8 +236,8 @@ PERMS = { # Minimum admin_level to perform action.
'USER_LINK': 4,
'ADMIN_ADD': 4,
'ADMIN_REMOVE': 4,
'CHANGE_ALL_HOLE_SETTINGS': 4,
'MODS_EVERY_HOLE': 5,
'MODS_EVERY_GROUP': 5,
'INFINITE_CURRENCY': 5,
@ -995,6 +995,7 @@ if SITE in {'rdrama.net', 'staging.rdrama.net'}:
elif SITE in {'watchpeopledie.tv', 'marsey.world'}:
PERMS['CSS_DISABLED'] = 3
PERMS['HOLE_CREATE'] = 4
PERMS['MODS_EVERY_HOLE'] = 4
NOTIFICATION_SPAM_AGE_THRESHOLD = 0.5 * 86400
TRUESCORE_MINIMUM = 100

View File

@ -412,10 +412,7 @@ def create_sub2(v):
@auth_required
def hole_settings(v, hole):
hole = get_hole(hole)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
return render_template('hole/settings.html', v=v, sidebar=hole.sidebar, hole=hole, css=hole.css, snappy_quotes=hole.snappy_quotes)
@ -427,10 +424,7 @@ def hole_settings(v, hole):
@auth_required
def post_hole_sidebar(v, hole):
hole = get_hole(hole)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(400)
sidebar = request.values.get('sidebar', '').strip()
@ -468,10 +462,7 @@ def post_hole_css(v, hole):
css = request.values.get('css', '').strip()
if not hole: abort(404)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(400)
if len(css) > CSS_LENGTH_LIMIT:
@ -512,10 +503,7 @@ def upload_hole_sidebar(v, hole):
if g.is_tor: abort(403, "File uploads are not allowed through TOR")
hole = get_hole(hole)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(500)
file = request.files["image"]
@ -544,9 +532,7 @@ def upload_hole_sidebar(v, hole):
@auth_required
def delete_hole_sidebar(v, hole):
hole = get_hole(hole)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if not hole.sidebarurls:
abort(404, f"Sidebar image not found (/h/{hole.name} has no sidebar images)")
@ -581,10 +567,7 @@ def upload_hole_banner(v, hole):
if g.is_tor: abort(403, "File uploads are not allowed through TOR")
hole = get_hole(hole)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(500)
file = request.files["image"]
@ -613,9 +596,7 @@ def upload_hole_banner(v, hole):
@auth_required
def delete_hole_banner(v, hole):
hole = get_hole(hole)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if not hole.bannerurls:
abort(404, f"Banner not found (/h/{hole.name} has no banner images)")
@ -650,10 +631,7 @@ def hole_marsey(v, hole):
if g.is_tor: abort(403, "File uploads are not allowed through TOR!")
hole = get_hole(hole)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(500)
file = request.files["marsey"]
@ -763,11 +741,9 @@ def hole_unpin(v, pid):
@auth_required
def hole_stealth(v, hole):
hole = get_hole(hole)
if hole.name in {'mnn','glory','racist'} and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
if hole.name in {'mnn','glory','racist'} and v.admin_level < PERMS["MODS_EVERY_HOLE"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
hole.stealth = not hole.stealth
g.db.add(hole)
@ -800,8 +776,7 @@ def hole_stealth(v, hole):
def hole_public_use(v, hole):
hole = get_hole(hole)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if hole in {'furry','vampire','racist','femboy','edgy'}:
abort(400, "House holes can't have Public Use mode enabled.")
@ -972,10 +947,7 @@ def post_hole_snappy_quotes(v, hole):
snappy_quotes = request.values.get('snappy_quotes', '').strip()
if not hole: abort(404)
if not v.mods_hole(hole.name) and v.admin_level < PERMS["CHANGE_ALL_HOLE_SETTINGS"]:
abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(400)
if snappy_quotes.endswith('[para]'):