Changed change_master_pass to be more readable
This commit is contained in:
parent
fb850e3737
commit
37a81ed22d
@ -7,10 +7,10 @@ from . import models
|
|||||||
def change_master_pass(
|
def change_master_pass(
|
||||||
engine: Engine, user_id: int, salt: bytes, passwd: bytes
|
engine: Engine, user_id: int, salt: bytes, passwd: bytes
|
||||||
) -> None:
|
) -> None:
|
||||||
statement = sqlmodel.update(
|
statement = (
|
||||||
models.MasterPass,
|
sqlmodel.update(models.MasterPass)
|
||||||
models.MasterPass.user_id == user_id,
|
.where(models.MasterPass.user_id == user_id)
|
||||||
{"salt": salt, "passwd": passwd},
|
.values(salt=salt, passwd=passwd)
|
||||||
)
|
)
|
||||||
with sqlmodel.Session(engine) as session:
|
with sqlmodel.Session(engine) as session:
|
||||||
session.exec(statement)
|
session.exec(statement)
|
||||||
|
Reference in New Issue
Block a user