Merge pull request #16599 from adityahase/python3-fix
fix(py3): Use six.text_type instead of unicode
This commit is contained in:
commit
a9f20d801d
@ -4,6 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import json
|
||||
from six import text_type
|
||||
from frappe import _
|
||||
from frappe.utils import flt, get_datetime, getdate, date_diff, cint, nowdate
|
||||
from frappe.model.document import Document
|
||||
@ -591,10 +592,10 @@ def make_timesheet(production_order, company):
|
||||
|
||||
@frappe.whitelist()
|
||||
def add_timesheet_detail(timesheet, args):
|
||||
if isinstance(timesheet, unicode):
|
||||
if isinstance(timesheet, text_type):
|
||||
timesheet = frappe.get_doc('Timesheet', timesheet)
|
||||
|
||||
if isinstance(args, unicode):
|
||||
if isinstance(args, text_type):
|
||||
args = json.loads(args)
|
||||
|
||||
timesheet.append('time_logs', args)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from six import text_type
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
@ -60,7 +61,7 @@ def _make_naming_series_key(prefix):
|
||||
:param prefix: Naming series prefix gotten from Stock Settings
|
||||
:return: The derived key. If no prefix is given, an empty string is returned
|
||||
"""
|
||||
if not unicode(prefix):
|
||||
if not text_type(prefix):
|
||||
return ''
|
||||
else:
|
||||
return prefix.upper() + '.#####'
|
||||
|
@ -3,6 +3,7 @@ import frappe, requests
|
||||
from frappe import _
|
||||
from jinja2 import utils
|
||||
from html2text import html2text
|
||||
from six import text_type
|
||||
from frappe.utils import sanitize_html
|
||||
from frappe.utils.global_search import search
|
||||
|
||||
@ -73,7 +74,7 @@ def prepare_api_results(api, topics_data):
|
||||
for topic in topics_data:
|
||||
route = api.base_url + '/' + (api.post_route + '/' if api.post_route else "")
|
||||
for key in api.post_route_key_list.split(','):
|
||||
route += unicode(topic[key])
|
||||
route += text_type(topic[key])
|
||||
|
||||
results.append(frappe._dict({
|
||||
'title': topic[api.post_title_key],
|
||||
|
Loading…
x
Reference in New Issue
Block a user