Fix shenanigans with the ui user edition

This commit is contained in:
Théophile Diot 2023-12-29 16:16:11 +00:00
parent 91448f1f45
commit fdb01b3059
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -1700,7 +1700,7 @@ class Database:
return ""
def update_ui_user(self, username: str, password: bytes, is_two_factor_enabled: bool = False, secret_token: Optional[str] = None) -> str:
def update_ui_user(self, username: str, password: bytes, is_two_factor_enabled: bool = False, secret_token: Optional[str] = None, method: str = "ui") -> str:
"""Update ui user."""
with self.__db_session() as session:
user = session.query(Users).filter_by(id=1).first()
@ -1711,6 +1711,7 @@ class Database:
user.password = password.decode("utf-8")
user.is_two_factor_enabled = is_two_factor_enabled
user.secret_token = secret_token
user.method = method
try:
session.commit()