- log.error("Cannot open snippet file for book id = %d [rev=%s], %s" % (book_id, revision, e))
+ book = catalogue.models.Book.objects.filter(id=book_id)
+ if not book:
+ log.error("Book does not exist for book id = %d" % book_id)
+ elif not book.get().children.exists():
+ log.error("Cannot open snippet file for book id = %d [rev=%s], %s" % (book_id, revision, e))