- customizations.remove('no-cover')
- pdf = Book.objects.get(pk=book_id).wldocument().as_pdf(
- customizations=customizations,
- morefloats=settings.LIBRARIAN_PDF_MOREFLOATS,
- **kwargs)
- DefaultStorage().save(file_name, File(open(pdf.get_filename())))
+ customizations.remove('nocover')
+ wldoc = Book.objects.get(pk=book_id).wldocument()
+ pdf = wldoc.as_pdf(
+ customizations=customizations,
+ morefloats=settings.LIBRARIAN_PDF_MOREFLOATS,
+ ilustr_path=gallery_path(wldoc.book_info.url.slug),
+ **kwargs)
+ DefaultStorage().save(file_name, File(open(pdf.get_filename(), 'rb')))