Fixes wildly high similiarity metrics in directory

This commit is contained in:
Mouse Reeve
2021-03-28 10:32:58 -07:00
parent ef057dd573
commit c42719ee1e
2 changed files with 48 additions and 0 deletions

View File

@ -205,6 +205,7 @@ def get_suggested_users(user, *args, **kwargs):
~Q(id__in=user.following.all()),
following__in=user.following.all(),
),
distinct=True
),
shared_books=Count(
"shelfbook",
@ -214,6 +215,7 @@ def get_suggested_users(user, *args, **kwargs):
s.book.parent_work for s in user.shelfbook_set.all()
],
),
distinct=True
),
)
)