functioning polls

This commit is contained in:
2025-12-12 20:01:09 +01:00
parent bd6f94a976
commit d7fdc1e183
5 changed files with 24 additions and 11 deletions
+2 -2
View File
@@ -28,11 +28,11 @@ def vote_in_poll(db: Connection, poll_name: str, option: str, points: int) -> bo
if poll_option_exists(db, poll_name, option):
try:
cursor = db.execute(
"UPDATE polls SET progress = progress + ? WHERE poll_name = ? and option = ?",
"UPDATE polls SET points = points + ? WHERE poll_name = ? and option = ?",
(points, poll_name, option)
)
db.commit()
return True
except Error as e:
current_app.logger.error(f"Error occurred updating milestone: {e.args[0]}")
current_app.logger.error(f"Error occurred updating poll: {e.args[0]}")
return False