From 18a5524b295619382c9438b8de44627e3acc28b0 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Fri, 30 Jun 2017 16:54:41 +0200 Subject: [PATCH] fix error messages about missing snippet files --- src/search/index.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/search/index.py b/src/search/index.py index ffad25788..c84841b19 100644 --- a/src/search/index.py +++ b/src/search/index.py @@ -139,7 +139,6 @@ class Index(SolrIndex): else: return False - # WTF def index_tags(self, *tags, **kw): """ Re-index global tag list. @@ -828,7 +827,9 @@ class Search(SolrIndex): idx += 1 except IOError, e: - log.error("Cannot open snippet file for book id = %d [rev=%s], %s" % (book_id, revision, e)) + book = catalogue.models.Book.objects.get(id=book_id) + if not book.children.exists(): + log.error("Cannot open snippet file for book id = %d [rev=%s], %s" % (book_id, revision, e)) return [] finally: snippets.close() -- 2.20.1