From 978cebb1b548404b47e5cf9731311dbe08762d58 Mon Sep 17 00:00:00 2001 From: kthoden Date: Wed, 2 Sep 2020 13:50:30 +0200 Subject: [PATCH] Use display entry when main entry is absent --- src/imxml2django.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/imxml2django.py b/src/imxml2django.py index 30feefd..b04eb20 100755 --- a/src/imxml2django.py +++ b/src/imxml2django.py @@ -878,6 +878,9 @@ def make_index(index_hits, index_type): for xmlEOAindex in index_hits: strMainEntry = xmlEOAindex.get("main") str_display_entry = xmlEOAindex.get("display") + if len(strMainEntry) == 0: + strMainEntry = str_display_entry + logging.warning("Index found without main entry, only display string. Using display string for sorting.") # If strMainEntry not in Index, then create new index element if strMainEntry not in dictIndex: