perf(minor): remove unnecessary comprehensions (port #25645)

This commit is contained in:
Ankush Menat
2021-06-11 18:40:22 +05:30
committed by GitHub
parent a424c0c023
commit 9891780f5a
64 changed files with 126 additions and 126 deletions

View File

@@ -54,7 +54,7 @@ class Company(NestedSet):
def validate_abbr(self):
if not self.abbr:
self.abbr = ''.join([c[0] for c in self.company_name.split()]).upper()
self.abbr = ''.join(c[0] for c in self.company_name.split()).upper()
self.abbr = self.abbr.strip()
@@ -335,7 +335,7 @@ class Company(NestedSet):
clear_defaults_cache()
def abbreviate(self):
self.abbr = ''.join([c[0].upper() for c in self.company_name.split()])
self.abbr = ''.join(c[0].upper() for c in self.company_name.split())
def on_trash(self):
"""

View File

@@ -139,7 +139,7 @@ def get_product_list_for_group(product_group=None, start=0, limit=10, search=Non
# return child item groups if the type is of "Is Group"
return get_child_groups_for_list_in_html(item_group, start, limit, search)
child_groups = ", ".join([frappe.db.escape(i[0]) for i in get_child_groups(product_group)])
child_groups = ", ".join(frappe.db.escape(i[0]) for i in get_child_groups(product_group))
# base query
query = """select I.name, I.item_name, I.item_code, I.route, I.image, I.website_image, I.thumbnail, I.item_group,
@@ -239,7 +239,7 @@ def get_item_for_list_in_html(context):
return frappe.get_template(products_template).render(context)
def get_group_item_count(item_group):
child_groups = ", ".join(['"' + i[0] + '"' for i in get_child_groups(item_group)])
child_groups = ", ".join('"' + i[0] + '"' for i in get_child_groups(item_group))
return frappe.db.sql("""select count(*) from `tabItem`
where docstatus = 0 and show_in_website = 1
and (item_group in (%s)