X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/454635a6a1b93154e38eb761ac1e7e403f165a81..2dd9e6498b5e0bd5c0bd882db02be9768c34c019:/src/depot/publishers/woblink.py diff --git a/src/depot/publishers/woblink.py b/src/depot/publishers/woblink.py index c3ec7a52..3e1c78c8 100644 --- a/src/depot/publishers/woblink.py +++ b/src/depot/publishers/woblink.py @@ -187,6 +187,7 @@ class Woblink(BasePublisher): (self.ROLE_TRANSLATOR, meta.translators, False) ]: for person_literal in items: + if person_literal is None: continue if person_literal.lang != 'pl': if errors is not None: if obligatory: @@ -313,12 +314,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 +333,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ł)',