This commit is contained in:
Daniil
2026-04-07 13:42:45 +03:00
parent 7d2f444e1c
commit 259d3da89f
34 changed files with 2130 additions and 788 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ class UserService:
async def create_user(self, data: UserCreate, *, requester: User | None) -> User:
# Keep Django behavior: any authenticated user can create via this endpoint.
if requester is None:
raise ValueError("Authentication required")
raise ValueError("Требуется авторизация")
return await self._repo.create(data=data)
async def register_user(self, data: UserRegister) -> User:
@@ -42,7 +42,7 @@ class UserService:
async def change_password(self, user: User, current_password: str, new_password: str) -> None:
if not verify_password(current_password, user.password_hash):
raise ValueError("Current password is incorrect")
raise ValueError("Текущий пароль неверен")
new_hash = hash_password(new_password)
await self._repo.update_password(user, new_hash)