X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0f76fabe3eb1842b6515d2571844bd63e894d07c..e194da857835c3bd9dcbdc9faf39189b6ec514d3:/apps/search/index.py?ds=sidebyside diff --git a/apps/search/index.py b/apps/search/index.py index ead10b5dd..dc33575bc 100644 --- a/apps/search/index.py +++ b/apps/search/index.py @@ -650,9 +650,10 @@ class SearchResult(object): self.book_id = int(stored.get("book_id")) pd = stored.get("published_date") - if pd is None: - pd = 0 - self.published_date = int(pd) + try: + self.published_date = int(pd) + except ValueError: + self.published_date = 0 header_type = stored.get("header_type") # we have a content hit in some header of fragment