This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
PassManager/src/db/change.py

23 lines
593 B
Python

import sqlmodel
from sqlalchemy.future import Engine
from . import models
def change_master_pass(
engine: Engine,
master_password: models.MasterPass,
) -> None:
"""Changes master password and salt in the database"""
statement = (
sqlmodel.update(models.MasterPass)
.where(models.MasterPass.user_id == master_password.user_id)
.values(
salt=master_password.salt,
password_hash=master_password.password_hash,
)
)
with sqlmodel.Session(engine) as session:
session.exec(statement)
session.commit()