mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 08:36:32 +00:00
Merge branch 'main' of github.com:bookwyrm-social/bookwyrm
This commit is contained in:
commit
a3e2cd77a1
1 changed files with 7 additions and 3 deletions
|
@ -33,9 +33,13 @@ class User(View):
|
||||||
# only show shelves that should be visible
|
# only show shelves that should be visible
|
||||||
is_self = request.user.id == user.id
|
is_self = request.user.id == user.id
|
||||||
if not is_self:
|
if not is_self:
|
||||||
shelves = models.Shelf.privacy_filter(
|
shelves = (
|
||||||
|
models.Shelf.privacy_filter(
|
||||||
request.user, privacy_levels=["public", "followers"]
|
request.user, privacy_levels=["public", "followers"]
|
||||||
).filter(user=user, books__isnull=False)
|
)
|
||||||
|
.filter(user=user, books__isnull=False)
|
||||||
|
.distinct()
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
shelves = user.shelf_set.filter(books__isnull=False).distinct()
|
shelves = user.shelf_set.filter(books__isnull=False).distinct()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue