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:
cd40895
)
fix in publishing
author
Jan Szejko
<jan.szejko@gmail.com>
Wed, 6 Apr 2016 12:11:54 +0000
(14:11 +0200)
committer
Jan Szejko
<jan.szejko@gmail.com>
Wed, 6 Apr 2016 12:11:54 +0000
(14:11 +0200)
src/catalogue/models/book.py
patch
|
blob
|
history
diff --git
a/src/catalogue/models/book.py
b/src/catalogue/models/book.py
index
f1501d0
..
3811bba
100644
(file)
--- a/
src/catalogue/models/book.py
+++ b/
src/catalogue/models/book.py
@@
-251,9
+251,10
@@
class Book(models.Model):
def download_pictures(self, remote_gallery_url):
gallery_path = self.gallery_path()
# delete previous files, so we don't include old files in ebooks
def download_pictures(self, remote_gallery_url):
gallery_path = self.gallery_path()
# delete previous files, so we don't include old files in ebooks
- for filename in os.listdir(gallery_path):
- file_path = os.path.join(gallery_path, filename)
- os.unlink(file_path)
+ if os.path.isdir(gallery_path):
+ for filename in os.listdir(gallery_path):
+ file_path = os.path.join(gallery_path, filename)
+ os.unlink(file_path)
ilustr_elements = list(self.wldocument().edoc.findall('//ilustr'))
if ilustr_elements:
makedirs(gallery_path)
ilustr_elements = list(self.wldocument().edoc.findall('//ilustr'))
if ilustr_elements:
makedirs(gallery_path)