added commits to delete funcs

This commit is contained in:
StNicolay 2022-10-30 00:30:45 +03:00
parent fab8e18723
commit fae04547c8

View File

@ -8,6 +8,7 @@ def purge_accounts(engine: Engine, user_id: int) -> None:
statement = sqlmodel.delete(models.Account).where(models.Account.user_id == user_id) statement = sqlmodel.delete(models.Account).where(models.Account.user_id == user_id)
with sqlmodel.Session(engine) as session: with sqlmodel.Session(engine) as session:
session.exec(statement) session.exec(statement)
session.commit()
def delete_master_pass(engine: Engine, user_id: int) -> None: def delete_master_pass(engine: Engine, user_id: int) -> None:
@ -16,6 +17,7 @@ def delete_master_pass(engine: Engine, user_id: int) -> None:
) )
with sqlmodel.Session(engine) as session: with sqlmodel.Session(engine) as session:
session.exec(statement) session.exec(statement)
session.commit()
def delete_account(engine: Engine, user_id: int, name: str) -> None: def delete_account(engine: Engine, user_id: int, name: str) -> None:
@ -24,3 +26,4 @@ def delete_account(engine: Engine, user_id: int, name: str) -> None:
) )
with sqlmodel.Session(engine) as session: with sqlmodel.Session(engine) as session:
session.exec(statement) session.exec(statement)
session.commit()