Python formtting
This commit is contained in:
parent
b0e1095fe6
commit
2490aa07aa
|
@ -34,20 +34,23 @@ class Feed(View):
|
||||||
|
|
||||||
paginated = Paginator(activities, PAGE_LENGTH)
|
paginated = Paginator(activities, PAGE_LENGTH)
|
||||||
|
|
||||||
suggested_users = models.User.objects.filter(
|
suggested_users = (
|
||||||
|
models.User.objects.filter(
|
||||||
~Q(id__in=request.user.following.all()),
|
~Q(id__in=request.user.following.all()),
|
||||||
~Q(id=request.user.id),
|
~Q(id=request.user.id),
|
||||||
discoverable=True,
|
discoverable=True,
|
||||||
is_active=True,
|
is_active=True,
|
||||||
bookwyrm_user=True,
|
bookwyrm_user=True,
|
||||||
).annotate(
|
)
|
||||||
|
.annotate(
|
||||||
mutuals=Count(
|
mutuals=Count(
|
||||||
"following",
|
"following",
|
||||||
filter=Q(
|
filter=Q(following__in=request.user.following.all()),
|
||||||
following__in=request.user.following.all()
|
)
|
||||||
),
|
)
|
||||||
|
.order_by("-mutuals", "-last_active_date")
|
||||||
|
.all()[:5]
|
||||||
)
|
)
|
||||||
).order_by("-mutuals", "-last_active_date").all()[:5]
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
**feed_page_data(request.user),
|
**feed_page_data(request.user),
|
||||||
|
|
Loading…
Reference in New Issue