Skip to content

Commit

Permalink
Revert "🏗️ No DB Autocommit before closing the DB Connection. Commit …
Browse files Browse the repository at this point in the history
…now Explicitally"

This reverts commit 94c7442.
  • Loading branch information
joshkreud committed Mar 8, 2024
1 parent 0997df9 commit d7b1657
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/godoo_cli/commands/db/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def connect(self):
cr = connection.cursor()
try:
yield cr
LOGGER.debug("Committing DB cursor")
connection.commit()
except Exception as e:
LOGGER.warning("Rolling Back DB cursor. Got Exception: %s", e)
connection.rollback()
Expand Down
1 change: 0 additions & 1 deletion src/godoo_cli/commands/db/passwords.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def set_passwords(
with connection.connect() as conn:
try:
conn.execute(f"UPDATE res_users SET password='{hashed_pw}'")
conn.commit()
except Exception:
raise typer.Exit(1)
LOGGER.info("Password for all users set to: '%s'", new_password)

0 comments on commit d7b1657

Please sign in to comment.