mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
chore: Clean up imports (#27302)
* chore: Added isort to pre-commit config * chore: Sort imports with isort * chore: Clean up imports with pycln * chore: Sort imports with isort * chore: Fix import issues * chore: Clean up sider issues * chore: Remove import errors from flake8 ignore list * chore: Clean up lint issues
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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.serve import get_response
|
||||
|
||||
|
||||
class TestHomepage(unittest.TestCase):
|
||||
def test_homepage_load(self):
|
||||
set_request(method='GET', path='home')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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.serve import get_response
|
||||
|
||||
|
||||
class TestHomepageSection(unittest.TestCase):
|
||||
def test_homepage_section_card(self):
|
||||
try:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.utils import cint
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cint
|
||||
|
||||
|
||||
class ProductsSettings(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestProductsSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import frappe
|
||||
|
||||
|
||||
class ItemVariantsCacheManager:
|
||||
def __init__(self, item_code):
|
||||
self.item_code = item_code
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from bs4 import BeautifulSoup
|
||||
import frappe, unittest
|
||||
from frappe.utils import get_html_for_route
|
||||
|
||||
from erpnext.portal.product_configurator.utils import get_products_for_website
|
||||
|
||||
test_dependencies = ["Item"]
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import frappe
|
||||
from frappe.utils import cint
|
||||
|
||||
from erpnext.portal.product_configurator.item_variants_cache import ItemVariantsCacheManager
|
||||
from erpnext.shopping_cart.product_info import get_product_info_for_website
|
||||
from erpnext.setup.doctype.item_group.item_group import get_child_groups
|
||||
from erpnext.shopping_cart.product_info import get_product_info_for_website
|
||||
|
||||
|
||||
def get_field_filter_data():
|
||||
product_settings = get_product_settings()
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import get_shopping_cart_settings
|
||||
from erpnext.shopping_cart.cart import get_debtors_account
|
||||
from frappe.utils.nestedset import get_root_of
|
||||
|
||||
from erpnext.shopping_cart.cart import get_debtors_account
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import (
|
||||
get_shopping_cart_settings,
|
||||
)
|
||||
|
||||
|
||||
def set_default_role(doc, method):
|
||||
'''Set customer, supplier, student, guardian based on email'''
|
||||
if frappe.flags.setting_role or frappe.flags.in_migrate:
|
||||
|
||||
Reference in New Issue
Block a user