Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Drop unused code
Marcin Gębala12ce1328eb8c
diff --git a/saleor/cart/views.py b/saleor/cart/views.pyindex 95e0b39602..789e3d668c 100644--- a/saleor/cart/views.py+++ b/saleor/cart/views.py@@ -1,21 +1,17 @@from __future__ import unicode_literals-from allauth.utils import get_request_paramfrom babeldjango.templatetags.babel import currencyfmtfrom django.core.urlresolvers import reverse-from django.http import HttpResponseRedirect, JsonResponse+from django.http import JsonResponsefrom django.shortcuts import get_object_or_404, redirect, renderfrom django.template.response import TemplateResponsefrom ..core.utils import to_local_currency, get_user_shipping_countryfrom ..product.models import ProductVariant-from ..product.templatetags.product_images import get_thumbnailfrom ..shipping.utils import get_shipment_optionsfrom .forms import ReplaceCartLineForm, CountryFormfrom .models import Cart-from .utils import (check_product_availability_and_warn,- find_and_assign_anonymous_cart, get_or_create_db_cart,- get_or_empty_db_cart)+from .utils import (check_product_availability_and_warn, get_or_empty_db_cart)@get_or_empty_db_cart(cart_queryset=Cart.objects.for_display())diff --git a/saleor/order/models.py b/saleor/order/models.pyindex 29fdfd6aa7..571e8fabc7 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -20,7 +20,7 @@ from satchless.item import ItemLine, ItemSetfrom ..core.utils import build_absolute_urifrom ..discount.models import Voucher-from ..product.models import Product, Stock+from ..product.models import Productfrom ..userprofile.models import Addressfrom ..search import indexfrom . import Statusdiff --git a/saleor/product/forms.py b/saleor/product/forms.pyindex 0b4a2bd8a5..235c35c8a9 100644--- a/saleor/product/forms.py+++ b/saleor/product/forms.py@@ -40,20 +40,3 @@ class ProductForm(AddToCartForm):def get_variant(self, cleaned_data):return cleaned_data.get('variant')--class ProductVariantInline(forms.models.BaseInlineFormSet):- error_no_items = pgettext_lazy(- 'Product admin error', 'You have to create at least one variant')-- def clean(self):- count = 0- for form in self.forms:- if form.cleaned_data:- count += 1- if count < 1:- raise forms.ValidationError(self.error_no_items)---class ImageInline(ProductVariantInline):- error_no_items = pgettext_lazy(- 'Product admin error', 'You have to add at least one image')