From 43751ccde2a98ed2257819e558c5b177e0453bae Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 26 Apr 2022 16:18:57 +0200 Subject: [PATCH] vdx --- files/classes/submission.py | 6 +++--- files/routes/posts.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index 3c3afaaa1..ed9e0e860 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -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: diff --git a/files/routes/posts.py b/files/routes/posts.py index 2fe5ab328..fed793592 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -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,