mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
Complete type annotations for API endpoints.
This commit is contained in:
1 parent
cefab8d362
commit
9404c00411
35 files changed
+730
-414
No files matched your search
@@ -59,7 +59,7 @@ class UsersRepository(BaseRepository):
|
||||
|
||||
async def create_user(self, user: schemas.UserCreate) -> models.User:
|
||||
|
||||
hashed_password = self._auth_service.hash_password(user.password)
|
||||
hashed_password = self._auth_service.hash_password(user.password.get_secret_value())
|
||||
db_user = models.User(
|
||||
username=user.username, email=user.email, full_name=user.full_name, hashed_password=hashed_password
|
||||
)
|
||||
@@ -73,7 +73,7 @@ class UsersRepository(BaseRepository):
|
||||
update_values = user_update.dict(exclude_unset=True)
|
||||
password = update_values.pop("password", None)
|
||||
if password:
|
||||
update_values["hashed_password"] = self._auth_service.hash_password(password=password)
|
||||
update_values["hashed_password"] = self._auth_service.hash_password(password=password.get_secret_value())
|
||||
|
||||
query = update(models.User).where(models.User.user_id == user_id).values(update_values)
|
||||
|
||||
|
||||
Reference in new issue
Block a user