Fixed an error of deleting all passwords, instead of 1 with command delete_account

This commit is contained in:
StNicolay 2022-10-30 23:03:26 +03:00
parent 99c24d9917
commit b7120f2627

View File

@ -22,7 +22,7 @@ def delete_master_pass(engine: Engine, user_id: int) -> None:
def delete_account(engine: Engine, user_id: int, name: str) -> None:
statement = sqlmodel.delete(models.Account).where(
models.Account.user_id == user_id and models.Account.name == name
models.Account.user_id == user_id, models.Account.name == name
)
with sqlmodel.Session(engine) as session:
session.exec(statement)