forked from mirrors/bookwyrm
Fixes searching for users in get started view
This commit is contained in:
parent
f9d7512ffd
commit
c918edb622
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue