diff --git a/files/classes/user.py b/files/classes/user.py index 903f256a4..898962bdd 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -584,7 +584,7 @@ class User(Base): Notification.user_id == self.id, Comment.is_banned == False, Comment.deleted_utc == 0, - not_(and_(Comment.sentto == 2, User.is_muted)), + not_(and_(Comment.sentto == MODMAIL_ID, User.is_muted)), )) if not self.can_see_shadowbanned: @@ -980,7 +980,7 @@ class User(Base): if not other.parent_submission: if not user: return False if not other.sentto: return True # handled by Notification - if other.sentto == 2: return user.admin_level >= PERMS['VIEW_MODMAIL'] # type: ignore + if other.sentto == MODMAIL_ID: return user.admin_level >= PERMS['VIEW_MODMAIL'] # type: ignore if other.sentto != user.id: return user.admin_level >= PERMS['POST_COMMENT_MODERATION'] # type: ignore if other.parent_submission and other.post.sub and not cls.can_see(user, other.post.subr): return False # if other.parent_submission and not cls.can_see(user, other.post): return False diff --git a/files/helpers/const.py b/files/helpers/const.py index 184f5efe1..2e9f0d991 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -429,6 +429,7 @@ MOM_ID = 0 DONGER_ID = 0 GEESE_ID = 0 BLACKJACKBTZ_ID = 0 +MODMAIL_ID = 2 POLL_THREAD = 0 POLL_BET_COINS = 200 diff --git a/files/routes/jinja2.py b/files/routes/jinja2.py index 801bb7594..16ee713bf 100644 --- a/files/routes/jinja2.py +++ b/files/routes/jinja2.py @@ -44,7 +44,7 @@ def timestamp(timestamp): @app.context_processor def inject_constants(): return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, - "AUTOJANNY_ID":AUTOJANNY_ID, "PUSHER_ID":PUSHER_ID, + "AUTOJANNY_ID":AUTOJANNY_ID, "MODMAIL_ID":MODMAIL_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "os_path":path, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "time":time, "PERMS":PERMS, "FEATURES":FEATURES, diff --git a/files/routes/notifications.py b/files/routes/notifications.py index 28a573fee..696a72c34 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -272,8 +272,8 @@ def notifications(v): Comment.is_banned == False, Comment.deleted_utc == 0, Comment.body_html.notlike('%