X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/2890d9e9df234b3e13fb0581337bc2d678ffdcb0..491078616e2129745f300c1f0357f5bac52e801d:/src/depot/publishers/legimi.py diff --git a/src/depot/publishers/legimi.py b/src/depot/publishers/legimi.py index 6802d149..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( @@ -261,7 +265,7 @@ class Legimi(BasePublisher): site_book.external_id = legimi_id site_book.save(update_fields=['external_id']) - self.edit_sale(book) + self.edit_sale(site_book) def get_genre(self, wlbook): if wlbook.meta.legimi and wlbook.meta.legimi in self.CATEGORIES: