Merges display of lists to show all
Rather than separating out "your lists"
This commit is contained in:
@ -27,17 +27,13 @@ class Lists(View):
|
||||
except ValueError:
|
||||
page = 1
|
||||
|
||||
user = request.user if request.user.is_authenticated else None
|
||||
# hide lists with no approved books
|
||||
lists = (
|
||||
models.List.objects.filter(
|
||||
~Q(user=user),
|
||||
)
|
||||
.annotate(item_count=Count("listitem", filter=Q(listitem__approved=True)))
|
||||
.filter(item_count__gt=0)
|
||||
.distinct()
|
||||
.all()
|
||||
)
|
||||
lists = models.List.objects.annotate(
|
||||
item_count=Count("listitem", filter=Q(listitem__approved=True))
|
||||
).filter(
|
||||
item_count__gt=0
|
||||
).distinct().all()
|
||||
|
||||
lists = privacy_filter(
|
||||
request.user, lists, privacy_levels=["public", "followers"]
|
||||
)
|
||||
|
Reference in New Issue
Block a user