Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix code styling issues

Marcin Gębala179286469af2
diff --git a/saleor/checkout/models.py b/saleor/checkout/models.py
index e47bbebd16..c39b7ab5f8 100644
--- a/saleor/checkout/models.py
+++ b/saleor/checkout/models.py
@@ -1,7 +1,6 @@
"""Cart-related ORM models."""
-from operator import attrgetter
-
from decimal import Decimal
+from operator import attrgetter
from uuid import uuid4
from django.conf import settings
diff --git a/saleor/graphql/payment/mutations.py b/saleor/graphql/payment/mutations.py
index 35aa426fd7..e554c3b8fe 100644
--- a/saleor/graphql/payment/mutations.py
+++ b/saleor/graphql/payment/mutations.py
@@ -6,8 +6,7 @@ from ...core.utils import get_client_ip
from ...core.utils.taxes import get_taxes_for_address
from ...payment import PaymentError
from ...payment.utils import (
- create_payment, gateway_authorize, gateway_capture, gateway_charge,
- gateway_refund, gateway_void)
+ create_payment, gateway_capture, gateway_refund, gateway_void)
from ..account.i18n import I18nMixin
from ..account.types import AddressInput
from ..checkout.types import Checkout
diff --git a/saleor/payment/utils.py b/saleor/payment/utils.py
index 25fb98f8bd..7a4d39eeaf 100644
--- a/saleor/payment/utils.py
+++ b/saleor/payment/utils.py
@@ -9,17 +9,16 @@ from django.core.serializers.json import DjangoJSONEncoder
from django.db import transaction
from django.utils.translation import pgettext_lazy
+from . import (
+ ChargeStatus, CustomPaymentChoices, GatewayError, OperationType,
+ PaymentError, TransactionKind, get_payment_gateway)
from ..account.models import Address, User
-from ..core import analytics
from ..checkout.models import Cart
+from ..core import analytics
from ..order import OrderEvents, OrderEventsEmails
from ..order.emails import send_payment_confirmation
from ..order.models import Order
from .models import Payment, Transaction
-from . import (
- CustomPaymentChoices, ChargeStatus, GatewayError, OperationType,
- PaymentError, TransactionKind, get_payment_gateway)
-
logger = logging.getLogger(__name__)
@@ -99,14 +98,16 @@ def validate_payment(view):
def create_payment(
- gateway: str, total: Decimal,
- currency: str, email: str, billing_address: Address,
+ gateway: str,
+ total: Decimal,
+ currency: str,
+ email: str,
+ billing_address: Address,
customer_ip_address: str = '',
payment_token: str = '',
extra_data: Dict = None,
checkout: Cart = None,
- order: Order = None
- ) -> Payment:
+ order: Order = None) -> Payment:
"""Create a payment instance.
This method is responsible for creating payment instances that works for