mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 03:21:05 +00:00
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()
|
||||
# this is a constructed "all books" view, with a fake "shelf" obj
|
||||
else:
|
||||
FakeShelf = namedtuple("Shelf", ("identifier", "name", "user", "books"))
|
||||
FakeShelf = namedtuple(
|
||||
"Shelf", ("identifier", "name", "user", "books", "privacy")
|
||||
)
|
||||
books = models.Edition.objects.filter(
|
||||
shelfbook__shelf__in=shelves.all()
|
||||
).distinct()
|
||||
shelf = FakeShelf("all", _("All books"), user, books)
|
||||
shelf = FakeShelf("all", _("All books"), user, books, "public")
|
||||
|
||||
is_self = request.user == user
|
||||
|
||||
|
|
Loading…
Reference in a new issue