Merge pull request #1775 from bookwyrm-social/order-suggestions

Sort suggestions by mutuals
This commit is contained in:
Mouse Reeve 2022-01-06 13:12:51 -08:00 committed by GitHub
commit 602574566b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,7 +95,7 @@ class SuggestedUsers(RedisStore):
).annotate(mutuals=Case(*annotations, output_field=IntegerField(), default=0))
if local:
users = users.filter(local=True)
return users[:5]
return users.order_by("-mutuals")[:5]
def get_annotated_users(viewer, *args, **kwargs):