chore: Cleanup imports (#27320)

* chore: Added isort to pre-commit config

* chore: Sort imports with isort

* chore: Remove imports with pycln

* chore: Sort imports with isort

* chore: Fix import issues

* chore: Fix sider issues

* chore: linting

* chore: linting / sorting import

from ecommerce refactor merge

* ci: dont allow unused imports

* chore: sort / clean ecommerce imports

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
Chillar Anand
2021-09-03 18:57:43 +05:30
committed by GitHub
parent 910b9bc3f4
commit 4b2be2999f
2103 changed files with 7844 additions and 3106 deletions

View File

@@ -3,10 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def validate(self):
if not self.description:

View File

@@ -3,11 +3,13 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from frappe.utils import set_request
from frappe.website.render import render
class TestHomepage(unittest.TestCase):
def test_homepage_load(self):
set_request(method='GET', path='home')

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class HomepageFeaturedProduct(Document):
pass

View File

@@ -3,9 +3,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
from frappe.utils import cint
class HomepageSection(Document):
@property
def column_value(self):

View File

@@ -3,12 +3,14 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from bs4 import BeautifulSoup
from frappe.utils import set_request
from frappe.website.render import render
class TestHomepageSection(unittest.TestCase):
def test_homepage_section_card(self):
try:

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class HomepageSectionCard(Document):
pass

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class WebsiteAttribute(Document):
pass

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class WebsiteFilterField(Document):
pass

View File

@@ -1,9 +1,14 @@
from __future__ import unicode_literals
import frappe
from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings
from erpnext.e_commerce.shopping_cart.cart import get_debtors_account
from frappe.utils.nestedset import get_root_of
from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import (
get_shopping_cart_settings,
)
from erpnext.e_commerce.shopping_cart.cart import get_debtors_account
def set_default_role(doc, method):
'''Set customer, supplier, student, guardian based on email'''
if frappe.flags.setting_role or frappe.flags.in_migrate: