forked from mirrors/bookwyrm
Adds privacy to fake shelf
This commit is contained in:
parent
a670c8d366
commit
f89e94b0c0
1 changed files with 4 additions and 2 deletions
|
@ -44,11 +44,13 @@ class Shelf(View):
|
||||||
return HttpResponseNotFound()
|
return HttpResponseNotFound()
|
||||||
# this is a constructed "all books" view, with a fake "shelf" obj
|
# this is a constructed "all books" view, with a fake "shelf" obj
|
||||||
else:
|
else:
|
||||||
FakeShelf = namedtuple("Shelf", ("identifier", "name", "user", "books"))
|
FakeShelf = namedtuple(
|
||||||
|
"Shelf", ("identifier", "name", "user", "books", "privacy")
|
||||||
|
)
|
||||||
books = models.Edition.objects.filter(
|
books = models.Edition.objects.filter(
|
||||||
shelfbook__shelf__in=shelves.all()
|
shelfbook__shelf__in=shelves.all()
|
||||||
).distinct()
|
).distinct()
|
||||||
shelf = FakeShelf("all", _("All books"), user, books)
|
shelf = FakeShelf("all", _("All books"), user, books, "public")
|
||||||
|
|
||||||
is_self = request.user == user
|
is_self = request.user == user
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue