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('%

New site mention%= PERMS['NOTIFICATIONS_MODMAIL'], User.id != v.id) if SITE == 'watchpeopledie.tv': admins = admins.filter(User.id != AEVANN_ID) diff --git a/files/templates/comments.html b/files/templates/comments.html index 8958ac7e8..64d757649 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -93,7 +93,7 @@ {% elif c.author_id==AUTOJANNY_ID %} Notification {% else %} - {% if c.sentto == 2 %} + {% if c.sentto == MODMAIL_ID %} Sent to admins {% else %} Sent to @{{c.senttouser.username}} @@ -566,7 +566,7 @@ {% if request.path.startswith('/notifications') and c.level == 1 and c.sentto and not c.parent_submission and c.author_id != AUTOJANNY_ID %} - {% if (v and v.admin_level >= PERMS['USER_BAN']) and (c.sentto == 2) %} + {% if (v and v.admin_level >= PERMS['USER_BAN']) and (c.sentto == MODMAIL_ID) %} {% endif %} @@ -581,7 +581,7 @@

- {% if c.sentto == 2 %} + {% if c.sentto == MODMAIL_ID %}