From b4d9e400d99502acd430cee38ad26cf05320555a Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 25 Sep 2022 19:37:38 +0200 Subject: [PATCH] Handle None as identifier value during upload --- cps/epub.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cps/epub.py b/cps/epub.py index d358d038..00ce907b 100644 --- a/cps/epub.py +++ b/cps/epub.py @@ -102,11 +102,11 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): identifiers = [] for node in p.xpath('dc:identifier', namespaces=ns): - identifier_name=node.attrib.values()[-1]; - identifier_value=node.text; - if identifier_name in ('uuid','calibre'): - continue; - identifiers.append( [identifier_name, identifier_value] ) + identifier_name = node.attrib.values()[-1] + identifier_value = node.text + if identifier_name in ('uuid', 'calibre') or identifier_value is None: + continue + identifiers.append([identifier_name, identifier_value]) if not epub_metadata['title']: title = original_file_name