Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

Commit

Permalink
Update routes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
marquelzikri authored Oct 10, 2019
1 parent d036753 commit 8beb06b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion title_links/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def search_widget(doctype, txt, query=None, searchfield=None, start=0,

# find relevance as location of search term from the beginning of string
# `name`. used for sorting results.
fields.append('locate("{0}", `tab{1}`.name) as _relevance'.format(frappe.db.escape((txt or "").replace("%", "")), frappe.db.escape(doctype)))
fields.append('locate("{0}", `tab{1}`.name) as _relevance'
.format(frappe.db.escape((txt or "").replace("%", "")), frappe.db.escape(doctype).replace("\'", "")))

# In order_by, `idx` gets second priority, because it stores link count
from frappe.model.db_query import get_order_by
Expand Down

0 comments on commit 8beb06b

Please sign in to comment.