Skip to content

Commit

Permalink
fixes for missing isbn
Browse files Browse the repository at this point in the history
  • Loading branch information
maxromanovsky authored Mar 8, 2018
1 parent 2a69160 commit 72b2c82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions safaribooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def create_content_opf(self):
for sub in self.book_info["subjects"])

return self.CONTENT_OPF.format(
(self.book_info["isbn"] if len(self.book_info["isbn"]) else self.book_id),
(self.book_info["isbn"] if (isinstance(self.book_info["isbn"], str) and len(self.book_info["isbn"])) else self.book_id),
escape(self.book_title),
authors,
escape(self.book_info["description"]),
Expand Down Expand Up @@ -918,7 +918,7 @@ def create_toc(self):

navmap, _, max_depth = self.parse_toc(response)
return self.TOC_NCX.format(
(self.book_info["isbn"] if len(self.book_info["isbn"]) else self.book_id),
(self.book_info["isbn"] if (isinstance(self.book_info["isbn"], str) and len(self.book_info["isbn"])) else self.book_id),
max_depth,
self.book_title,
", ".join(aut["name"] for aut in self.book_info["authors"]),
Expand Down

0 comments on commit 72b2c82

Please sign in to comment.