remotes/1693045480750635534/spooky-22
Aevann1 2022-04-26 16:18:57 +02:00
parent 5afa0c0d2a
commit 43751ccde2
2 changed files with 5 additions and 5 deletions

View File

@ -88,19 +88,19 @@ class Submission(Base):
@property
@lazy
def options(self):
return g.db.query(Comment).filter_by(parent_submission = self.id, author_id = AUTOPOLLER_ID, level=1).order_by(Comment.id)
return g.db.query(Comment).filter_by(parent_submission = self.id, author_id = AUTOPOLLER_ID, level=1).order_by(Comment.id).all()
@property
@lazy
def choices(self):
return g.db.query(Comment).filter_by(parent_submission = self.id, author_id = AUTOCHOICE_ID, level=1).order_by(Comment.id)
return g.db.query(Comment).filter_by(parent_submission = self.id, author_id = AUTOCHOICE_ID, level=1).order_by(Comment.id).all()
@property
@lazy
def bet_options(self):
return g.db.query(Comment).filter_by(parent_submission = self.id, author_id = AUTOBETTER_ID, level=1)
return g.db.query(Comment).filter_by(parent_submission = self.id, author_id = AUTOBETTER_ID, level=1).all()
def total_poll_voted(self, v):
if v:

View File

@ -476,7 +476,7 @@ def edit_post(pid, v):
if body != p.body:
if v.id == p.author_id and v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
if not p.options.count():
if not p.options:
for i in poll_regex.finditer(body):
body = body.replace(i.group(0), "")
c = Comment(author_id=AUTOPOLLER_ID,
@ -488,7 +488,7 @@ def edit_post(pid, v):
)
g.db.add(c)
if not p.choices.count():
if not p.choices:
for i in choice_regex.finditer(body):
body = body.replace(i.group(0), "")
c = Comment(author_id=AUTOCHOICE_ID,