diff --git a/generators/search.py b/generators/search.py index 8e99547..d182722 100644 --- a/generators/search.py +++ b/generators/search.py @@ -44,7 +44,10 @@ class Search(Index): posts = [] for post_id in post_list: - post = Post.objects.get(pk=post_id) + try: + post = Post.objects.get(pk=post_id) + except: + continue if not post is None: posts.append(post) diff --git a/search.py b/search.py index cdad7c6..5ebd3e2 100644 --- a/search.py +++ b/search.py @@ -148,7 +148,7 @@ class Search: def _index_post(self, blog, post, saveDatabase=True): hashtable = self._loadDatabase(blog) - filename = blog.src_path + '/_post/' + post + filename = blog.src_path + '/_post/' + str(post) if hashtable is None: return self.create_index(blog)