X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/8ac06f56a164a1860e6c33ac7fd65167d9714cb1..46b8dca20c77629901ed4fc3d398436180649c71:/src/catalogue/views.py diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 50dde9f5b..62221855d 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -609,13 +609,14 @@ class CustomPDFFormView(AjaxableFormView): @ssi_included def book_mini(request, pk, with_link=True): - book = get_object_or_404(models.Book, pk=pk) - author_str = ", ".join(tag.name for tag in book.tags.filter(category='author')) + # book = get_object_or_404(models.Book, pk=pk) + try: + book = models.Book.objects.only('cover_thumb', 'title', 'language', 'slug').get(pk=pk) + except models.Book.DoesNotExist: + raise Http404 return render(request, 'catalogue/book_mini_box.html', { 'book': book, - 'author_str': author_str, - 'with_link': with_link, - 'show_lang': book.language_code() != settings.LANGUAGE_CODE, + 'no_link': not with_link, })