Skip to content

Commit

Permalink
feat(auth): is_followed_back
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisCusihuaman committed Dec 6, 2023
1 parent ba4061d commit 2b75030
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions identity_socializer/web/api/auth/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class AppUserModel(BaseModel):
profile_photo_id: Optional[str]
ubication: Optional[str]
is_followed: Optional[bool]
is_followed_back: Optional[bool] = False
blocked: bool = False
certified: bool = False
model_config = ConfigDict(from_attributes=True)
2 changes: 2 additions & 0 deletions identity_socializer/web/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ async def complete_user(
) -> AppUserModel:
"""Returns a user with additional information."""
is_followed = await relationship_dao.is_followed_by_user(current_user_id, user.id)
is_followed_back = await relationship_dao.is_followed_by_user(user.id, current_user_id)

return AppUserModel(
id=user.id,
Expand All @@ -39,5 +40,6 @@ async def complete_user(
profile_photo_id=user.profile_photo_id,
ubication=user.ubication,
is_followed=is_followed,
is_followed_back=is_followed_back,
blocked=user.blocked,
)

0 comments on commit 2b75030

Please sign in to comment.