- 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,
+ base_url=absolute_url(gallery_url(wldoc.book_info.url.slug)),
+ **kwargs)
+ DefaultStorage().save(file_name, File(open(pdf.get_filename(), 'rb')))