X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/608e6d8048124bd547efca2ce65ea0b7907ff697..0da29a22a23a90561df3d201a299f3007c84d524:/apps/catalogue/templatetags/book_list.py diff --git a/apps/catalogue/templatetags/book_list.py b/apps/catalogue/templatetags/book_list.py index f5b7e647..f7e70474 100755 --- a/apps/catalogue/templatetags/book_list.py +++ b/apps/catalogue/templatetags/book_list.py @@ -103,6 +103,9 @@ def document_list_filter(request, **kwargs): chunks = chunks.order_by('book__title', 'book', 'number') + if not request.user.is_authenticated(): + chunks = chunks.filter(book__public=True) + state = arg_or_GET('status') if state in _states_dict: chunks = chunks.filter(_states_dict[state]) @@ -127,6 +130,7 @@ def book_list(context, user=None): '-count', 'last_name', 'first_name')} new_context.update({ + "filters": True, "request": request, "books": ChunksList(document_list_filter(request, **filters)), "stages": Chunk.tag_model.objects.all(), @@ -134,4 +138,3 @@ def book_list(context, user=None): }) return new_context -