mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 10:01:04 +00:00
Linting on suggested_users
This commit is contained in:
parent
ad6d7d5eca
commit
4a43ad95ef
1 changed files with 12 additions and 10 deletions
|
@ -29,6 +29,7 @@ class SuggestedUsers(RedisStore):
|
|||
|
||||
def get_counts_from_rank(self, rank): # pylint: disable=no-self-use
|
||||
"""calculate mutuals count and shared books count from rank"""
|
||||
# pylint: disable=c-extension-no-member
|
||||
return {
|
||||
"mutuals": math.floor(rank),
|
||||
# "shared_books": int(1 / (-1 * (rank % 1 - 1))) - 1,
|
||||
|
@ -119,16 +120,17 @@ def get_annotated_users(viewer, *args, **kwargs):
|
|||
),
|
||||
distinct=True,
|
||||
),
|
||||
# shared_books=Count(
|
||||
# "shelfbook",
|
||||
# filter=Q(
|
||||
# ~Q(id=viewer.id),
|
||||
# shelfbook__book__parent_work__in=[
|
||||
# s.book.parent_work for s in viewer.shelfbook_set.all()
|
||||
# ],
|
||||
# ),
|
||||
# distinct=True,
|
||||
# ),
|
||||
# pylint: disable=line-too-long
|
||||
# shared_books=Count(
|
||||
# "shelfbook",
|
||||
# filter=Q(
|
||||
# ~Q(id=viewer.id),
|
||||
# shelfbook__book__parent_work__in=[
|
||||
# s.book.parent_work for s in viewer.shelfbook_set.all()
|
||||
# ],
|
||||
# ),
|
||||
# distinct=True,
|
||||
# ),
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue