fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
099e83b
)
Fixed importing books from Django admin.
author
Marek Stępniowski
<marek@stepniowski.com>
Thu, 11 Dec 2008 15:13:43 +0000
(16:13 +0100)
committer
Marek Stępniowski
<marek@stepniowski.com>
Thu, 11 Dec 2008 15:13:43 +0000
(16:13 +0100)
apps/catalogue/models.py
patch
|
blob
|
history
diff --git
a/apps/catalogue/models.py
b/apps/catalogue/models.py
index
ad56496
..
6ab090d
100644
(file)
--- a/
apps/catalogue/models.py
+++ b/
apps/catalogue/models.py
@@
-233,7
+233,9
@@
class Book(models.Model):
book_descendants += list(child_book.children.all())
# Save XML and HTML files
book_descendants += list(child_book.children.all())
# Save XML and HTML files
- book.xml_file.save('%s.xml' % book.slug, File(file(xml_file)), save=False)
+ if not isinstance(xml_file, File):
+ xml_file = File(file(xml_file))
+ book.xml_file.save('%s.xml' % book.slug, xml_file, save=False)
html_file = NamedTemporaryFile()
if html.transform(book.xml_file.path, html_file):
html_file = NamedTemporaryFile()
if html.transform(book.xml_file.path, html_file):