fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add method for splitting a book
[redakcja.git]
/
apps
/
catalogue
/
views.py
diff --git
a/apps/catalogue/views.py
b/apps/catalogue/views.py
index
8723685
..
3c0e70f
100644
(file)
--- a/
apps/catalogue/views.py
+++ b/
apps/catalogue/views.py
@@
-257,7
+257,7
@@
def book_pdf(request, slug):
try:
pdf_file = NamedTemporaryFile(delete=False)
try:
pdf_file = NamedTemporaryFile(delete=False)
- pdf.transform(RedakcjaDocProvider(),
+ pdf.transform(RedakcjaDocProvider(
publishable=True
),
file_path=xml_file.name,
output_file=pdf_file,
)
file_path=xml_file.name,
output_file=pdf_file,
)
@@
-283,7
+283,8
@@
def book_epub(request, slug):
xml_file.flush()
epub_file = StringIO()
xml_file.flush()
epub_file = StringIO()
- epub.transform(RedakcjaDocProvider(), file_path=xml_file.name,
+ epub.transform(RedakcjaDocProvider(publishable=True),
+ file_path=xml_file.name,
output_file=epub_file)
response = HttpResponse(mimetype='application/epub+zip')
response['Content-Disposition'] = 'attachment; filename=%s' % book.slug + '.epub'
output_file=epub_file)
response = HttpResponse(mimetype='application/epub+zip')
response['Content-Disposition'] = 'attachment; filename=%s' % book.slug + '.epub'