Complete type annotations for API endpoints.

This commit is contained in:
grossmj committed 2021-04-18 15:40:38 +09:30
1 parent cefab8d362
commit 9404c00411
35 files changed
+730 -414

No files matched your search

+2 -2
View File
@@ -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)