diff --git a/files/classes/submission.py b/files/classes/submission.py index 3c3afaaa13..ed9e0e860f 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 2fe5ab328c..fed793592c 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,