Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
PEP8
Pacu241b3fc48f580
diff --git a/saleor/dashboard/product/views.py b/saleor/dashboard/product/views.pyindex a05a03cdc4..0c2af55672 100644--- a/saleor/dashboard/product/views.py+++ b/saleor/dashboard/product/views.py@@ -305,7 +305,8 @@ def variant_details(request, product_pk, variant_pk):images = variant.images.all()margin = get_margin_for_variant(variant)- discounted_price = variant.get_price(discounts=Sale.objects.active(date.today())).gross+ discounted_price = variant.get_price(+ discounts=Sale.objects.active(date.today())).grossctx = {'images': images, 'product': product, 'variant': variant,'margin': margin, 'discounted_price': discounted_price}diff --git a/saleor/data_feeds/google_merchant.py b/saleor/data_feeds/google_merchant.pyindex 7f7fa9e223..9b809a1e85 100644--- a/saleor/data_feeds/google_merchant.py+++ b/saleor/data_feeds/google_merchant.py@@ -196,8 +196,8 @@ def write_feed(file_obj):writer = csv.DictWriter(file_obj, ATTRIBUTES, dialect=csv.excel_tab)writer.writeheader()categories = Category.objects.all()- discounts = Sale.objects.active(date.today()).prefetch_related('products',- 'categories')+ discounts = Sale.objects.active(date.today()).prefetch_related(+ 'products', 'categories')attributes_dict = {a.slug: a.pk for a in ProductAttribute.objects.all()}attribute_values_dict = {smart_text(a.pk): smart_text(a) for ain AttributeChoiceValue.objects.all()}diff --git a/saleor/discount/models.py b/saleor/discount/models.pyindex 151504ab76..202f94309e 100644--- a/saleor/discount/models.py+++ b/saleor/discount/models.py@@ -130,8 +130,8 @@ class Voucher(models.Model):msg = pgettext('Voucher not applicable','This offer is only valid for orders over %(amount)s.')- raise NotApplicable(msg % {- 'amount': amount(min_amount_spent)},+ raise NotApplicable(+ msg % { 'amount': amount(min_amount_spent)},min_amount_spent=min_amount_spent)diff --git a/saleor/discount/utils.py b/saleor/discount/utils.pyindex 9bd5482dc9..166a9b233f 100644--- a/saleor/discount/utils.py+++ b/saleor/discount/utils.py@@ -1,7 +1,7 @@from django.db.models import Ffrom django.utils.translation import pgettext-from ..core.utils.taxes import ZERO_TAXED_MONEY, ZERO_MONEY+from ..core.utils.taxes import ZERO_MONEY, ZERO_TAXED_MONEYfrom .models import NotApplicable@@ -43,7 +43,8 @@ def get_product_discount_on_sale(sale, product):return sale.get_discount()raise NotApplicable(pgettext(- 'Voucher not applicable', 'Discount not applicable for this product'))+ 'Voucher not applicable',+ 'Discount not applicable for this product'))def get_product_discounts(product, discounts):diff --git a/saleor/graphql/discount/types.py b/saleor/graphql/discount/types.pyindex 6720fb1380..641e743d63 100644--- a/saleor/graphql/discount/types.py+++ b/saleor/graphql/discount/types.py@@ -1,8 +1,7 @@import graphenefrom graphene import relay-from ...discount import (- DiscountValueType, VoucherType, models)+from ...discount import DiscountValueType, VoucherType, modelsfrom ..core.types.common import CountableDjangoObjectType