mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 02:31:21 +00:00
chore: remove all six compat code
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from six import iteritems
|
||||
|
||||
import erpnext
|
||||
|
||||
@@ -45,7 +44,7 @@ def get_level():
|
||||
"Work Order": 5
|
||||
}
|
||||
|
||||
for doctype, min_count in iteritems(doctypes):
|
||||
for doctype, min_count in doctypes.items():
|
||||
count = frappe.db.count(doctype)
|
||||
if count > min_count:
|
||||
activation_level += 1
|
||||
|
||||
@@ -10,7 +10,6 @@ import pytz
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from pyyoutube import Api
|
||||
from six import string_types
|
||||
|
||||
|
||||
class Video(Document):
|
||||
@@ -87,7 +86,7 @@ def get_id_from_url(url):
|
||||
Returns video id from url
|
||||
:param youtube url: String URL
|
||||
"""
|
||||
if not isinstance(url, string_types):
|
||||
if not isinstance(url, str):
|
||||
frappe.throw(_("URL can only be a string"), title=_("Invalid URL"))
|
||||
|
||||
pattern = re.compile(r'[a-z\:\//\.]+(youtube|youtu)\.(com|be)/(watch\?v=|embed/|.+\?v=)?([^"&?\s]{11})?')
|
||||
|
||||
@@ -6,7 +6,6 @@ import frappe
|
||||
import frappe.share
|
||||
from frappe import _
|
||||
from frappe.utils import cint, cstr, flt, get_time, now_datetime
|
||||
from six import string_types
|
||||
|
||||
from erpnext.controllers.status_updater import StatusUpdater
|
||||
|
||||
@@ -178,7 +177,7 @@ def delete_events(ref_type, ref_name):
|
||||
frappe.delete_doc("Event", events, for_reload=True)
|
||||
|
||||
def validate_uom_is_integer(doc, uom_field, qty_fields, child_dt=None):
|
||||
if isinstance(qty_fields, string_types):
|
||||
if isinstance(qty_fields, str):
|
||||
qty_fields = [qty_fields]
|
||||
|
||||
distinct_uoms = list(set(d.get(uom_field) for d in doc.get_all_children()))
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
context.show_sidebar = True
|
||||
|
||||
Reference in New Issue
Block a user