From: Jan Szejko Date: Fri, 30 Jun 2017 14:54:41 +0000 (+0200) Subject: fix error messages about missing snippet files X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/18a5524b295619382c9438b8de44627e3acc28b0?ds=inline fix error messages about missing snippet files --- 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()