Changed change_master_pass to be more readable

This commit is contained in:
StNicolay 2022-11-02 18:34:02 +03:00
parent fb850e3737
commit 37a81ed22d

View File

@ -7,10 +7,10 @@ from . import models
def change_master_pass(
engine: Engine, user_id: int, salt: bytes, passwd: bytes
) -> None:
statement = sqlmodel.update(
models.MasterPass,
models.MasterPass.user_id == user_id,
{"salt": salt, "passwd": passwd},
statement = (
sqlmodel.update(models.MasterPass)
.where(models.MasterPass.user_id == user_id)
.values(salt=salt, passwd=passwd)
)
with sqlmodel.Session(engine) as session:
session.exec(statement)