mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-26 10:00:33 +00:00
Sort suggestions by mutuals
This commit is contained in:
parent
00a14e89a0
commit
deaa06d44c
1 changed files with 1 additions and 1 deletions
|
@ -95,7 +95,7 @@ class SuggestedUsers(RedisStore):
|
||||||
).annotate(mutuals=Case(*annotations, output_field=IntegerField(), default=0))
|
).annotate(mutuals=Case(*annotations, output_field=IntegerField(), default=0))
|
||||||
if local:
|
if local:
|
||||||
users = users.filter(local=True)
|
users = users.filter(local=True)
|
||||||
return users[:5]
|
return users.order_by("-mutuals")[:5]
|
||||||
|
|
||||||
|
|
||||||
def get_annotated_users(viewer, *args, **kwargs):
|
def get_annotated_users(viewer, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in a new issue