server/posts: fix reverse search late evaluation

Uploading webms caused 'Not an image.' error to be shown, cause
generators are evaluated lazily, so the `catch` never worked.
This commit is contained in:
rr- 2017-02-02 21:52:52 +01:00
parent accdb51c0b
commit f828c375e6

View file

@ -553,11 +553,13 @@ def search_by_image_exact(image_content):
def search_by_image(image_content):
ret = []
for result in image_hash.search_by_image(image_content):
yield PostLookalike(
ret.append(PostLookalike(
score=result.score,
distance=result.distance,
post=get_post_by_id(result.path))
post=get_post_by_id(result.path)))
return ret
def populate_reverse_search():