Skip to content

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

Drop unused code

Marcin Gębala12ce1328eb8c
diff --git a/saleor/cart/views.py b/saleor/cart/views.py
index 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_param
from babeldjango.templatetags.babel import currencyfmt
from django.core.urlresolvers import reverse
-from django.http import HttpResponseRedirect, JsonResponse
+from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.template.response import TemplateResponse
from ..core.utils import to_local_currency, get_user_shipping_country
from ..product.models import ProductVariant
-from ..product.templatetags.product_images import get_thumbnail
from ..shipping.utils import get_shipment_options
from .forms import ReplaceCartLineForm, CountryForm
from .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.py
index 29fdfd6aa7..571e8fabc7 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -20,7 +20,7 @@ from satchless.item import ItemLine, ItemSet
from ..core.utils import build_absolute_uri
from ..discount.models import Voucher
-from ..product.models import Product, Stock
+from ..product.models import Product
from ..userprofile.models import Address
from ..search import index
from . import Status
diff --git a/saleor/product/forms.py b/saleor/product/forms.py
index 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')