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: