Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegYurchik committed Nov 29, 2023
1 parent 23a71e3 commit 1abf29c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 28 deletions.
50 changes: 25 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ alembic = "^1.12.0"
aiokafka = "^0.8.1"
yarl = "^1.9.2"
pyjwt = "^2.8.0"
cryptography = "^41.0.4"
loguru = "^0.7.2"
websockets = "^11.0.3"
backoff = "^2.2.1"
Expand All @@ -37,6 +36,7 @@ typer = {version = "^0.9.0", extras = ["all"]}
redis = ">=4.2.0rc1"
pydantic = {version = "^2.5.1", extras = ["email"]}
py-fast-grpc = "^0.3.4"
cryptography = "^41.0.7"

[tool.poetry.extras]
sqlite = ["aiosqlite"]
Expand Down
2 changes: 1 addition & 1 deletion sapphire/users/database/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def get_user(
session: AsyncSession,
user_id: uuid.UUID | Type[Empty] = Empty,
email: str | Type[Empty] = Empty,
):
) -> User | None:
filters = []
if user_id is not Empty:
filters.append(User.id == user_id)
Expand Down
4 changes: 4 additions & 0 deletions sapphire/users/internal_api/client/service.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import uuid

import backoff
from grpc.aio import AioRpcError

from sapphire.users.internal_api.models import GetUserRequest, UserResponse
from sapphire.users.internal_api.service import UsersGRPCService

from .settings import UsersInternalAPIClientSettings


class UsersInternalAPIClient(UsersGRPCService.Client):
@backoff.on_exception(backoff.constant, AioRpcError, max_tries=3)
async def get_user(self, user_id: uuid.UUID) -> UserResponse:
request = GetUserRequest(id=user_id)
return await super().get_user(request=request)
Expand Down
2 changes: 1 addition & 1 deletion sapphire/users/internal_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class UserResponse(BaseModel):
email: EmailStr
first_name: str | None = None
last_name: str | None = None
is_activated: bool
is_activated: bool = False

about: str | None = None
main_specialization_id: uuid.UUID | None = None
Expand Down

0 comments on commit 1abf29c

Please sign in to comment.