search: fix bug where file path link was wrong when the repository

name was in the file path, fixes #4228
This commit is contained in:
Daniel Dourvaris 2016-09-15 11:45:55 +03:00
parent 92f3db90c9
commit a1e28ea6b7

View file

@ -265,7 +265,7 @@ class WhooshResultWrapper(object):
f_path = '' # noqa
if self.search_type in ['content', 'path']:
f_path = res['path'].split(res['repository'])[-1]
f_path = res['path'][len(res['repository']):]
f_path = f_path.lstrip(os.sep)
if self.search_type == 'content':