X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/462d84ea8718cd3ca1112fe11c2120a0f20f475f..45b36abf753366dd523cae85a8eced7e5c9711e0:/apps/search/index.py diff --git a/apps/search/index.py b/apps/search/index.py index df44888df..9972c2c56 100644 --- a/apps/search/index.py +++ b/apps/search/index.py @@ -653,7 +653,11 @@ class SearchResult(object): hits = sections.values() for f in frags: - frag = catalogue.models.Fragment.objects.get(anchor=f[FRAGMENT]) + try: + frag = catalogue.models.Fragment.objects.get(anchor=f[FRAGMENT]) + except catalogue.models.Fragment.DoesNotExist: + # stale index + continue # Figure out if we were searching for a token matching some word in theme name. themes = frag.tags.filter(category='theme')