From 2eae97d6a08da4b832ccc69ce66bd15009001737 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 11 Jul 2021 02:45:06 +0000 Subject: actually that could be slightly neater --- apioforum/thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apioforum/thread.py b/apioforum/thread.py index 20b02ca..daf0b85 100644 --- a/apioforum/thread.py +++ b/apioforum/thread.py @@ -127,7 +127,7 @@ def create_poll(thread_id): cur.execute("UPDATE threads SET poll = ? WHERE threads.id = ?",(pollid,thread_id)) cur.executemany( "INSERT INTO poll_options (poll,option_idx,text) VALUES (?,?,?)", - zip(itertools.repeat(pollid),range(1,len(polloptions)+1),polloptions) + zip(itertools.repeat(pollid),itertools.count(1),polloptions) ) db.commit() flash("poll created successfully") -- cgit v1.2.3