Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix isort issues
akjanikeff0b8c38060
diff --git a/saleor/account/backends/facebook.py b/saleor/account/backends/facebook.pyindex 408c0744c7..b372ac016e 100644--- a/saleor/account/backends/facebook.py+++ b/saleor/account/backends/facebook.py@@ -1,7 +1,7 @@from social_core.backends.facebook import FacebookOAuth2-from ...site import AuthenticationBackendsfrom . import BaseBackend+from ...site import AuthenticationBackendsclass CustomFacebookOAuth2(BaseBackend, FacebookOAuth2):diff --git a/saleor/account/backends/google.py b/saleor/account/backends/google.pyindex 4c83a52687..6c8e205b95 100644--- a/saleor/account/backends/google.py+++ b/saleor/account/backends/google.py@@ -1,7 +1,7 @@from social_core.backends.google import GoogleOAuth2-from ...site import AuthenticationBackendsfrom . import BaseBackend+from ...site import AuthenticationBackendsclass CustomGoogleOAuth2(BaseBackend, GoogleOAuth2):diff --git a/saleor/account/forms.py b/saleor/account/forms.pyindex 8aa8026316..63cd65f72d 100644--- a/saleor/account/forms.py+++ b/saleor/account/forms.py@@ -4,9 +4,9 @@ from django.contrib.auth import forms as django_forms, update_session_auth_hashfrom django.utils.translation import pgettext, pgettext_lazyfrom phonenumbers.phonenumberutil import country_code_for_region+from . import emailsfrom ..account.models import Userfrom .i18n import AddressMetaForm, get_address_form_class-from . import emailsdef get_address_form(diff --git a/saleor/account/views.py b/saleor/account/views.pyindex 1dac365430..7ed4dfdba2 100755--- a/saleor/account/views.py+++ b/saleor/account/views.py@@ -11,8 +11,8 @@ from django.utils.translation import pgettext, ugettext_lazy as _from ..cart.utils import find_and_assign_anonymous_cartfrom ..core.utils import get_paginator_itemsfrom .forms import (- ChangePasswordForm, get_address_form, LoginForm, logout_on_password_change,- PasswordResetForm, SignupForm)+ ChangePasswordForm, LoginForm, PasswordResetForm, SignupForm,+ get_address_form, logout_on_password_change)@find_and_assign_anonymous_cart()diff --git a/saleor/checkout/core.py b/saleor/checkout/core.pyindex b28952c76d..9b5ef07873 100644--- a/saleor/checkout/core.py+++ b/saleor/checkout/core.py@@ -17,7 +17,7 @@ from ..core import analyticsfrom ..core.utils import ZERO_TAXED_MONEYfrom ..discount.models import NotApplicable, Voucherfrom ..discount.utils import (- increase_voucher_usage, get_voucher_discount_for_checkout)+ get_voucher_discount_for_checkout, increase_voucher_usage)from ..order.models import Orderfrom ..shipping.models import ANY_COUNTRY, ShippingMethodCountrydiff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.pyindex ffc459be58..9a47c5a337 100644--- a/saleor/core/utils/random_data.py+++ b/saleor/core/utils/random_data.py@@ -13,6 +13,8 @@ from faker.providers import BaseProviderfrom payments import PaymentStatusfrom prices import Money, TaxedMoney+from ...account.models import Address, User+from ...account.utils import store_user_addressfrom ...discount import DiscountValueType, VoucherTypefrom ...discount.models import Sale, Voucherfrom ...order import GroupStatus@@ -21,8 +23,6 @@ from ...product.models import (AttributeChoiceValue, Category, Collection, Product, ProductAttribute,ProductImage, ProductType, ProductVariant, Stock, StockLocation)from ...shipping.models import ANY_COUNTRY, ShippingMethod-from ...account.models import Address, User-from ...account.utils import store_user_addressfake = Factory.create()STOCK_LOCATION = 'default'diff --git a/saleor/dashboard/customer/filters.py b/saleor/dashboard/customer/filters.pyindex 3ad702b7ac..fcd08e204c 100644--- a/saleor/dashboard/customer/filters.py+++ b/saleor/dashboard/customer/filters.py@@ -4,8 +4,8 @@ from django.utils.translation import npgettext, pgettext_lazyfrom django_countries import countriesfrom django_filters import CharFilter, ChoiceFilter, OrderingFilter-from ...core.filters import SortedFilterSetfrom ...account.models import User+from ...core.filters import SortedFilterSetSORT_BY_FIELDS = (('email', 'email'),diff --git a/saleor/dashboard/customer/views.py b/saleor/dashboard/customer/views.pyindex 020c88aa3b..11481a91cb 100644--- a/saleor/dashboard/customer/views.py+++ b/saleor/dashboard/customer/views.py@@ -6,8 +6,8 @@ from django.shortcuts import get_object_or_404, redirectfrom django.template.response import TemplateResponsefrom django.utils.translation import pgettext_lazy-from ...core.utils import get_paginator_itemsfrom ...account.models import User+from ...core.utils import get_paginator_itemsfrom ..emails import send_set_password_emailfrom ..views import staff_member_requiredfrom .filters import UserFilterdiff --git a/saleor/dashboard/graphql/api.py b/saleor/dashboard/graphql/api.pyindex 02a307329b..dcc9c67ef6 100644--- a/saleor/dashboard/graphql/api.py+++ b/saleor/dashboard/graphql/api.py@@ -6,7 +6,7 @@ from ...graphql.core.filters import DistinctFilterSetfrom ...graphql.product.types import Category, resolve_categoriesfrom ...graphql.utils import get_nodefrom .product.mutations import (- CategoryCreateMutation, CategoryUpdateMutation, CategoryDelete)+ CategoryCreateMutation, CategoryDelete, CategoryUpdateMutation)class Query(graphene.ObjectType):diff --git a/saleor/dashboard/graphql/mutations.py b/saleor/dashboard/graphql/mutations.pyindex 4fd4a4d269..78bd7f95e5 100644--- a/saleor/dashboard/graphql/mutations.py+++ b/saleor/dashboard/graphql/mutations.py@@ -7,8 +7,8 @@ from graphene.types.mutation import MutationOptionsfrom graphene_django.form_converter import convert_form_fieldfrom graphene_django.registry import get_global_registry-from ...graphql.utils import get_nodefrom ...graphql.core.types import Error+from ...graphql.utils import get_noderegistry = get_global_registry()diff --git a/saleor/dashboard/page/urls.py b/saleor/dashboard/page/urls.pyindex 1f2b907835..d6378a2b2c 100644--- a/saleor/dashboard/page/urls.py+++ b/saleor/dashboard/page/urls.py@@ -2,7 +2,6 @@ from django.conf.urls import urlfrom . import views-urlpatterns = [url(r'^$', views.page_list, name='page-list'),url(r'^add/$', views.page_add, name='page-add'),diff --git a/saleor/dashboard/staff/views.py b/saleor/dashboard/staff/views.pyindex 38f2bf5fcb..bab3dcc695 100644--- a/saleor/dashboard/staff/views.py+++ b/saleor/dashboard/staff/views.py@@ -5,8 +5,8 @@ from django.shortcuts import get_object_or_404, redirectfrom django.template.response import TemplateResponsefrom django.utils.translation import pgettext_lazy-from ...core.utils import get_paginator_itemsfrom ...account.models import User+from ...core.utils import get_paginator_itemsfrom ..emails import (send_promote_customer_to_staff_email, send_set_password_email)from ..views import staff_member_requireddiff --git a/saleor/dashboard/widgets.py b/saleor/dashboard/widgets.pyindex 80e00d3407..07df8ede1c 100644--- a/saleor/dashboard/widgets.py+++ b/saleor/dashboard/widgets.py@@ -4,8 +4,7 @@ from django.forms import Textareafrom django_filters.widgets import RangeWidgetfrom django_prices.widgets import MoneyInput-from ..account.widgets import (- PhonePrefixWidget as StorefrontPhonePrefixWidget)+from ..account.widgets import PhonePrefixWidget as StorefrontPhonePrefixWidgetclass DateRangeWidget(RangeWidget):diff --git a/saleor/discount/utils.py b/saleor/discount/utils.pyindex eb48fb05c1..f56bab3b61 100644--- a/saleor/discount/utils.py+++ b/saleor/discount/utils.py@@ -4,11 +4,11 @@ from django.utils.encoding import smart_textfrom django.utils.translation import pgettextfrom prices import Money, TaxedMoney+from . import VoucherApplyToProduct, VoucherTypefrom ..cart.utils import (get_category_variants_and_prices, get_product_variants_and_prices)from ..core.utils import ZERO_TAXED_MONEYfrom .models import NotApplicable-from . import VoucherApplyToProduct, VoucherTypedef increase_voucher_usage(voucher):diff --git a/saleor/graphql/api.py b/saleor/graphql/api.pyindex 57d2c46ce9..3533a33045 100644--- a/saleor/graphql/api.py+++ b/saleor/graphql/api.py@@ -5,8 +5,8 @@ from graphene_django.filter import DjangoFilterConnectionFieldfrom .core.filters import DistinctFilterSetfrom .product.filters import ProductFilterSetfrom .product.types import (- Category, ProductAttribute, Product, resolve_attributes, resolve_products,- resolve_categories)+ Category, Product, ProductAttribute, resolve_attributes,+ resolve_categories, resolve_products)from .utils import get_nodediff --git a/saleor/order/views.py b/saleor/order/views.pyindex e36fcc8b21..20a7b48641 100644--- a/saleor/order/views.py+++ b/saleor/order/views.py@@ -10,14 +10,14 @@ from django.template.response import TemplateResponsefrom django.utils.translation import pgettext_lazyfrom payments import PaymentStatus, RedirectNeeded+from . import OrderStatus+from ..account.forms import LoginFormfrom ..account.models import Userfrom ..core.utils import get_client_ip-from ..account.forms import LoginFormfrom .forms import (OrderNoteForm, PasswordForm, PaymentDeleteForm, PaymentMethodsForm)from .models import Order, OrderNote, Paymentfrom .utils import attach_order_to_user, check_order_status-from . import OrderStatuslogger = logging.getLogger(__name__)diff --git a/saleor/search/backends/postgresql_dashboard.py b/saleor/search/backends/postgresql_dashboard.pyindex f5c7513789..f0e2728691 100644--- a/saleor/search/backends/postgresql_dashboard.py+++ b/saleor/search/backends/postgresql_dashboard.py@@ -1,9 +1,9 @@from django.contrib.postgres.search import (SearchQuery, SearchRank, SearchVector)+from ...account.models import Userfrom ...order.models import Orderfrom ...product.models import Product-from ...account.models import Userdef search_products(phrase):diff --git a/tests/test_discounts.py b/tests/test_discounts.pyindex e45dcd07f5..95f872db8a 100644--- a/tests/test_discounts.py+++ b/tests/test_discounts.py@@ -11,8 +11,8 @@ from saleor.discount import (from saleor.discount.forms import CheckoutDiscountFormfrom saleor.discount.models import NotApplicable, Sale, Voucherfrom saleor.discount.utils import (- decrease_voucher_usage, increase_voucher_usage,- get_product_discount_on_sale, get_voucher_discount_for_checkout)+ decrease_voucher_usage, get_product_discount_on_sale,+ get_voucher_discount_for_checkout, increase_voucher_usage)from saleor.product.models import Product, ProductVariant