From 3c066ba7e839ef23861030410b03a3ff3cd70e6f Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 16 Oct 2023 15:30:56 +0200 Subject: [PATCH 1/1] Fix --- src/depot/publishers/legimi.py | 6 +++++- src/depot/publishers/woblink.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/depot/publishers/legimi.py b/src/depot/publishers/legimi.py index e6fe5b54..da222456 100644 --- a/src/depot/publishers/legimi.py +++ b/src/depot/publishers/legimi.py @@ -130,12 +130,16 @@ class Legimi(BasePublisher): }) def can_publish(self, site, book): - meta = book.wldocument(librarian2=True).meta d = { 'errors': [], 'warnings': [], 'info': [] } + try: + meta = book.wldocument(librarian2=True).meta + except: + d['errors'].append('Nieprawidłowy dokument.') + return d thema = self.get_thema(meta) if thema: d['info'].append(mark_safe( diff --git a/src/depot/publishers/woblink.py b/src/depot/publishers/woblink.py index c3ec7a52..0cd7a899 100644 --- a/src/depot/publishers/woblink.py +++ b/src/depot/publishers/woblink.py @@ -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: -- 2.20.1