refactor: add set admin to finally

This commit is contained in:
Shivam Mishra 2020-08-10 12:50:37 +05:30
parent f7d923396b
commit b76a01f28d

View file

@ -56,11 +56,11 @@ class WebsiteSearch(FullTextSearch):
text_content = page_content.text if page_content else ""
title = soup.title.text.strip() if soup.title else route
frappe.set_user("Administrator")
return frappe._dict(title=title, content=text_content, path=route)
except Exception:
pass
finally:
frappe.set_user("Administrator")
def parse_result(self, result):
title_highlights = result.highlights("title")