Fix bugs in search (string conversion)

This commit is contained in:
Gregory Soutade 2012-12-24 18:12:51 +01:00
parent 5077ab0a30
commit 919e9a5575
2 changed files with 5 additions and 2 deletions

View File

@ -44,7 +44,10 @@ class Search(Index):
posts = [] posts = []
for post_id in post_list: 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: if not post is None:
posts.append(post) posts.append(post)

View File

@ -148,7 +148,7 @@ class Search:
def _index_post(self, blog, post, saveDatabase=True): def _index_post(self, blog, post, saveDatabase=True):
hashtable = self._loadDatabase(blog) hashtable = self._loadDatabase(blog)
filename = blog.src_path + '/_post/' + post filename = blog.src_path + '/_post/' + str(post)
if hashtable is None: if hashtable is None:
return self.create_index(blog) return self.create_index(blog)