forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-10-06 02:04:35 +02:00
parent 4135990c84
commit 32cbc010e4
3 changed files with 6 additions and 5 deletions

View File

@ -4,7 +4,7 @@ from sqlalchemy.orm import relationship, deferred
import re, random import re, random
from urllib.parse import urlparse from urllib.parse import urlparse
from files.helpers.lazy import lazy 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 files.__main__ import Base
from .flags import Flag from .flags import Flag
from os import environ from os import environ
@ -74,7 +74,7 @@ class Submission(Base):
@property @property
@lazy @lazy
def options(self): def options(self):
return self.comments.filter_by(author_id = 3369) return self.comments.filter_by(author_id = AUTOPOLLER_ACCOUNT)
@property @property
@lazy @lazy

View File

@ -165,6 +165,7 @@ NOTIFICATIONS_ACCOUNT = 1046
if site == "pcmemes.net": AUTOJANNY_ACCOUNT = 1050 if site == "pcmemes.net": AUTOJANNY_ACCOUNT = 1050
else: AUTOJANNY_ACCOUNT = 2360 else: AUTOJANNY_ACCOUNT = 2360
LONGPOSTBOT_ACCOUNT = 1832 LONGPOSTBOT_ACCOUNT = 1832
AUTOPOLLER_ACCOUNT = 6176
PUSHER_INSTANCE_ID = '02ddcc80-b8db-42be-9022-44c546b4dce6' PUSHER_INSTANCE_ID = '02ddcc80-b8db-42be-9022-44c546b4dce6'
PUSHER_KEY = environ.get("PUSHER_KEY", "").strip() PUSHER_KEY = environ.get("PUSHER_KEY", "").strip()

View File

@ -124,7 +124,7 @@ def post_id(pid, anything=None, v=None):
comments=comments.filter( comments=comments.filter(
Comment.parent_submission == post.id, Comment.parent_submission == post.id,
Comment.author_id != 3369, Comment.author_id != AUTOPOLLER_ACCOUNT,
).join( ).join(
votes, votes,
votes.c.comment_id == Comment.id, votes.c.comment_id == Comment.id,
@ -162,7 +162,7 @@ def post_id(pid, anything=None, v=None):
else: else:
shadowbanned = [x[0] for x in g.db.query(User.id).options(lazyload('*')).filter(User.shadowbanned != None).all()] 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": if sort == "new":
comments = comments.order_by(Comment.created_utc.desc()) comments = comments.order_by(Comment.created_utc.desc())
@ -816,7 +816,7 @@ def submit_post(v):
g.db.flush() g.db.flush()
for option in options: for option in options:
c = Comment(author_id=3369, c = Comment(author_id=AUTOPOLLER_ACCOUNT,
parent_submission=new_post.id, parent_submission=new_post.id,
level=1, level=1,
body=option, body=option,