From 6d1bf593b94be78e15a7657a9adbd727bd59f69c Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 16 Oct 2023 15:28:03 +0200 Subject: [PATCH] fix for bad documents. --- src/isbn/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: -- 2.20.1