Fixes searching for users in get started view

This commit is contained in:
Mouse Reeve 2022-01-07 09:56:29 -08:00
parent f9d7512ffd
commit c918edb622

View file

@ -113,13 +113,16 @@ class GetStartedUsers(View):
.filter( .filter(
similarity__gt=0.5, similarity__gt=0.5,
) )
.exclude(
id=request.user.id,
)
.order_by("-similarity")[:5] .order_by("-similarity")[:5]
) )
data = {"no_results": not user_results} data = {"no_results": not user_results}
if user_results.count() < 5: if user_results.count() < 5:
user_results = list(user_results) + suggested_users.get_suggestions( user_results = list(user_results) + list(
request.user suggested_users.get_suggestions(request.user)
) )
data["suggested_users"] = user_results data["suggested_users"] = user_results