mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 01:51:08 +00:00
Python formtting
This commit is contained in:
parent
b0e1095fe6
commit
2490aa07aa
1 changed files with 16 additions and 13 deletions
|
@ -34,20 +34,23 @@ class Feed(View):
|
|||
|
||||
paginated = Paginator(activities, PAGE_LENGTH)
|
||||
|
||||
suggested_users = models.User.objects.filter(
|
||||
~Q(id__in=request.user.following.all()),
|
||||
~Q(id=request.user.id),
|
||||
discoverable=True,
|
||||
is_active=True,
|
||||
bookwyrm_user=True,
|
||||
).annotate(
|
||||
mutuals=Count(
|
||||
"following",
|
||||
filter=Q(
|
||||
following__in=request.user.following.all()
|
||||
),
|
||||
suggested_users = (
|
||||
models.User.objects.filter(
|
||||
~Q(id__in=request.user.following.all()),
|
||||
~Q(id=request.user.id),
|
||||
discoverable=True,
|
||||
is_active=True,
|
||||
bookwyrm_user=True,
|
||||
)
|
||||
).order_by("-mutuals", "-last_active_date").all()[:5]
|
||||
.annotate(
|
||||
mutuals=Count(
|
||||
"following",
|
||||
filter=Q(following__in=request.user.following.all()),
|
||||
)
|
||||
)
|
||||
.order_by("-mutuals", "-last_active_date")
|
||||
.all()[:5]
|
||||
)
|
||||
|
||||
data = {
|
||||
**feed_page_data(request.user),
|
||||
|
|
Loading…
Reference in a new issue