Skip to content

Commit

Permalink
fix: 추천 친구 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dkfla committed Aug 8, 2024
1 parent 8116cd0 commit 3e91f02
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions friends/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ def friend_list(request):
"restaurant_id", flat=True
)
)

friend_ids = friends.values_list("friend_id", flat=True)
potential_friends = (
User.objects.exclude(id=user.id)
.exclude(id__in=friend_ids)
.annotate(
common_restaurant_count=Count(
"userrestaurantslist__restaurant_id",
Expand Down Expand Up @@ -138,8 +141,13 @@ def friend_recommend(request):
"restaurant_id", flat=True
)
)

friend_ids = Friend.objects.filter(user=user).values_list(
"friend_id", flat=True
)
potential_friends = (
User.objects.exclude(id=user.id)
.exclude(id__in=friend_ids)
.annotate(
common_restaurant_count=Count(
"userrestaurantslist__restaurant_id",
Expand Down

0 comments on commit 3e91f02

Please sign in to comment.