From: Radek Czajka Date: Mon, 16 Oct 2023 13:28:03 +0000 (+0200) Subject: fix for bad documents. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/6d1bf593b94be78e15a7657a9adbd727bd59f69c fix for bad documents. --- diff --git a/src/isbn/models.py b/src/isbn/models.py index d2d62909..5c9bb449 100644 --- a/src/isbn/models.py +++ b/src/isbn/models.py @@ -134,7 +134,10 @@ class Isbn(models.Model): @classmethod def formats_from_document(cls, document): # This is a document - meta = document.wldocument(librarian2=True).meta + try: + meta = document.wldocument(librarian2=True).meta + except: + return [] is_parent = len(meta.parts) formats = [] for form, config in FORMS: