diff --git a/files/classes/submission.py b/files/classes/submission.py index 52fd00661..a201c56db 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -4,7 +4,7 @@ from sqlalchemy.orm import relationship, deferred import re, random from urllib.parse import urlparse from files.helpers.lazy import lazy -from files.helpers.const import SLURS +from files.helpers.const import SLURS, AUTOPOLLER_ACCOUNT from files.__main__ import Base from .flags import Flag from os import environ @@ -74,7 +74,7 @@ class Submission(Base): @property @lazy def options(self): - return self.comments.filter_by(author_id = 3369) + return self.comments.filter_by(author_id = AUTOPOLLER_ACCOUNT) @property @lazy diff --git a/files/helpers/const.py b/files/helpers/const.py index 06947ce03..2d0a026cc 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -165,6 +165,7 @@ NOTIFICATIONS_ACCOUNT = 1046 if site == "pcmemes.net": AUTOJANNY_ACCOUNT = 1050 else: AUTOJANNY_ACCOUNT = 2360 LONGPOSTBOT_ACCOUNT = 1832 +AUTOPOLLER_ACCOUNT = 6176 PUSHER_INSTANCE_ID = '02ddcc80-b8db-42be-9022-44c546b4dce6' PUSHER_KEY = environ.get("PUSHER_KEY", "").strip() diff --git a/files/routes/posts.py b/files/routes/posts.py index a06f03f1a..2f4086fb6 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -124,7 +124,7 @@ def post_id(pid, anything=None, v=None): comments=comments.filter( Comment.parent_submission == post.id, - Comment.author_id != 3369, + Comment.author_id != AUTOPOLLER_ACCOUNT, ).join( votes, votes.c.comment_id == Comment.id, @@ -162,7 +162,7 @@ def post_id(pid, anything=None, v=None): else: shadowbanned = [x[0] for x in g.db.query(User.id).options(lazyload('*')).filter(User.shadowbanned != None).all()] - comments = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.author_id != 3369, Comment.author_id.notin_(shadowbanned)) + comments = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.author_id != AUTOPOLLER_ACCOUNT, Comment.author_id.notin_(shadowbanned)) if sort == "new": comments = comments.order_by(Comment.created_utc.desc()) @@ -816,7 +816,7 @@ def submit_post(v): g.db.flush() for option in options: - c = Comment(author_id=3369, + c = Comment(author_id=AUTOPOLLER_ACCOUNT, parent_submission=new_post.id, level=1, body=option,