Modmail: constantify missed magic numbers

This commit is contained in:
justcool393 2023-02-16 22:30:57 -06:00 committed by Ben Rog-Wilhelm
parent 1574c46d0a
commit 50b6e06f62
5 changed files with 5 additions and 5 deletions

View file

@ -414,7 +414,7 @@ def change_settings(v, setting):
parent_submission=None,
level=1,
body_html=body_html,
sentto=2,
sentto=MODMAIL_ID,
distinguish_level=6
)
g.db.add(new_comment)

View file

@ -51,7 +51,7 @@ def notifications(v):
posts = request.values.get('posts')
reddit = request.values.get('reddit')
if modmail and v.admin_level > 1:
comments = g.db.query(Comment).filter(Comment.sentto==2).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all()
comments = g.db.query(Comment).filter(Comment.sentto == MODMAIL_ID).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all()
next_exists = (len(comments) > 25)
listing = comments[:25]
elif messages:

View file

@ -61,7 +61,7 @@ def request_api_keys(v):
parent_submission=None,
level=1,
body_html=body_html,
sentto=2,
sentto=MODMAIL_ID,
distinguish_level=6
)
g.db.add(new_comment)

View file

@ -329,7 +329,7 @@ def submit_contact(v: Optional[User]):
parent_submission=None,
level=1,
body_html=html,
sentto=2
sentto=MODMAIL_ID,
)
g.db.add(new_comment)
g.db.flush()

View file

@ -666,7 +666,7 @@ def messagereply(v):
)
if c.top_comment.sentto == 2:
if c.top_comment.sentto == MODMAIL_ID:
admins = g.db.query(User).filter(User.admin_level > 2, User.id != v.id).all()
for admin in admins:
notif = Notification(comment_id=c.id, user_id=admin.id)