mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
fix(py3): Replace unicode with six.text_type
This commit is contained in:
@@ -5,6 +5,7 @@ from jinja2 import utils
|
|||||||
from html2text import html2text
|
from html2text import html2text
|
||||||
from frappe.utils import sanitize_html
|
from frappe.utils import sanitize_html
|
||||||
from frappe.utils.global_search import search
|
from frappe.utils.global_search import search
|
||||||
|
from six import text_type
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
context.no_cache = 1
|
context.no_cache = 1
|
||||||
@@ -12,7 +13,7 @@ def get_context(context):
|
|||||||
query = str(utils.escape(sanitize_html(frappe.form_dict.q)))
|
query = str(utils.escape(sanitize_html(frappe.form_dict.q)))
|
||||||
context.title = _('Help Results for')
|
context.title = _('Help Results for')
|
||||||
context.query = query
|
context.query = query
|
||||||
|
|
||||||
context.route = '/search_help'
|
context.route = '/search_help'
|
||||||
d = frappe._dict()
|
d = frappe._dict()
|
||||||
d.results_sections = get_help_results_sections(query)
|
d.results_sections = get_help_results_sections(query)
|
||||||
@@ -73,7 +74,7 @@ def prepare_api_results(api, topics_data):
|
|||||||
for topic in topics_data:
|
for topic in topics_data:
|
||||||
route = api.base_url + '/' + (api.post_route + '/' if api.post_route else "")
|
route = api.base_url + '/' + (api.post_route + '/' if api.post_route else "")
|
||||||
for key in api.post_route_key_list.split(','):
|
for key in api.post_route_key_list.split(','):
|
||||||
route += unicode(topic[key])
|
route += text_type(topic[key])
|
||||||
|
|
||||||
results.append(frappe._dict({
|
results.append(frappe._dict({
|
||||||
'title': topic[api.post_title_key],
|
'title': topic[api.post_title_key],
|
||||||
|
|||||||
Reference in New Issue
Block a user