X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/96c3327c8c83e0c814b98216e6c73ca0f01abde6..f7135da39f77154495d308d05c46e7b30e964d2d:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 5f203808..564af626 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -252,7 +252,7 @@ def book_pdf(request, slug): # TODO: move to celery doc = book.wldocument() # TODO: error handling - pdf_file = doc.as_pdf(cover=True, ilustr_path=os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, book.gallery)) + pdf_file = doc.as_pdf(cover=True, ilustr_path=book.gallery_path()) from catalogue.ebook_utils import serve_file return serve_file(pdf_file.get_filename(), book.slug + '.pdf', 'application/pdf') @@ -267,7 +267,7 @@ def book_epub(request, slug): # TODO: move to celery doc = book.wldocument() # TODO: error handling - epub = doc.as_epub().get_string() + epub = doc.as_epub(ilustr_path=book.gallery_path()).get_string() response = HttpResponse(mimetype='application/epub+zip') response['Content-Disposition'] = 'attachment; filename=%s' % book.slug + '.epub' response.write(epub)