From beae00c105d6af08de13f52b3ee59c9fc08cdb2d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 14 Mar 2018 12:03:00 +0100 Subject: [PATCH] Fix /vote command --- db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.py b/db.py index 4034b9d0..5677cc9e 100644 --- a/db.py +++ b/db.py @@ -692,7 +692,7 @@ class VoteQuestion(Base): return f"" def generate_text(self, session: Session): - query = session.execute("SELECT * FROM telegram LEFT JOIN (SELECT voteanswer.question_id, voteanswer.user_id, voteanswer.choice FROM votequestion JOIN voteanswer ON votequestion.id = voteanswer.question_id WHERE votequestion.id = 8) answer ON telegram.telegram_id = answer.user_id ORDER BY answer.choice;") + query = session.execute("SELECT * FROM telegram LEFT JOIN (SELECT voteanswer.question_id, voteanswer.user_id, voteanswer.choice FROM votequestion JOIN voteanswer ON votequestion.id = voteanswer.question_id WHERE votequestion.message_id = " + str(self.message_id) + ") answer ON telegram.telegram_id = answer.user_id ORDER BY answer.choice;") text = f"{self.question}\n\n" none, yes, no, abstain = 0, 0, 0, 0 for record in query: