show isbn for woblink
[redakcja.git] / src / depot / publishers / woblink.py
index c3ec7a5..64eca06 100644 (file)
@@ -313,12 +313,16 @@ class Woblink(BasePublisher):
         return price
 
     def can_publish(self, site, book):
-        wldoc = book.wldocument(librarian2=True)
         d = {
             'warnings': [],
             'errors': [],
             'info': [],
         }
+        try:
+            wldoc = book.wldocument(librarian2=True)
+        except:
+            d['errors'].append('Nieprawidłowy dokument.')
+            return d
         errors = []
         book_data = self.get_book_data(site, wldoc, errors)
         for error in errors:
@@ -328,6 +332,12 @@ class Woblink(BasePublisher):
                 errlist = d['warnings']
             errlist.append(error.as_html())
 
+        if book_data.get('isbn'):
+            d['info'].append(format_html(
+                'ISBN: {isbn}',
+                isbn=book_data['isbn'],
+            ))
+
         if book_data.get('genres'):
             d['info'].append(format_html(
                 'W kategoriach: {cat} ({price} zł)',