File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed
Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ def migrate_db(db: sqlalchemy.engine.base.Engine) -> None:
5959 "( vote_id SERIAL NOT NULL, time_cast timestamp NOT NULL, "
6060 "candidate VARCHAR(6) NOT NULL, PRIMARY KEY (vote_id) );"
6161 ))
62+ conn .commit ()
6263
6364
6465# This global variable is declared with a value of `None`, instead of calling
@@ -139,6 +140,7 @@ def save_vote(db: sqlalchemy.engine.base.Engine, team: str) -> Response:
139140 # back into the pool at the end of statement (even if an error occurs)
140141 with db .connect () as conn :
141142 conn .execute (stmt , parameters = {"time_cast" : time_cast , "candidate" : team })
143+ conn .commit ()
142144 except Exception as e :
143145 # If something goes wrong, handle the error in this section. This might
144146 # involve retrying or adjusting parameters depending on the situation.
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ def migrate_db(db: sqlalchemy.engine.base.Engine) -> None:
5959 "( vote_id SERIAL NOT NULL, time_cast timestamp NOT NULL, "
6060 "candidate VARCHAR(6) NOT NULL, PRIMARY KEY (vote_id) );"
6161 ))
62+ conn .commit ()
6263
6364
6465# This global variable is declared with a value of `None`, instead of calling
@@ -139,6 +140,7 @@ def save_vote(db: sqlalchemy.engine.base.Engine, team: str) -> Response:
139140 # back into the pool at the end of statement (even if an error occurs)
140141 with db .connect () as conn :
141142 conn .execute (stmt , parameters = {"time_cast" : time_cast , "candidate" : team })
143+ conn .commit ()
142144 except Exception as e :
143145 # If something goes wrong, handle the error in this section. This might
144146 # involve retrying or adjusting parameters depending on the situation.
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ def save_vote(db: sqlalchemy.engine.base.Engine, team: str) -> Response:
137137 # back into the pool at the end of statement (even if an error occurs)
138138 with db .connect () as conn :
139139 conn .execute (stmt , parameters = {"time_cast" : time_cast , "candidate" : team })
140+ conn .commit ()
140141 except Exception as e :
141142 # If something goes wrong, handle the error in this section. This might
142143 # involve retrying or adjusting parameters depending on the situation.
You can’t perform that action at this time.
0 commit comments