Fixes flake8 errors arising from rebase

This commit is contained in:
Christopher Neugebauer 2016-04-29 11:22:56 +10:00
parent 135f2fb47b
commit b40505117f
7 changed files with 6 additions and 23 deletions

View file

@ -17,7 +17,6 @@ from registrasion.models import conditions
from registrasion.models import inventory from registrasion.models import inventory
from .category import CategoryController from .category import CategoryController
from .conditions import ConditionController
from .discount import DiscountController from .discount import DiscountController
from .flag import FlagController from .flag import FlagController
from .product import ProductController from .product import ProductController
@ -65,7 +64,6 @@ class CartController(object):
) )
return cls(existing) return cls(existing)
# Marks the carts that are currently in batches # Marks the carts that are currently in batches
_FOR_USER = {} _FOR_USER = {}
_BATCH_COUNT = collections.defaultdict(int) _BATCH_COUNT = collections.defaultdict(int)
@ -156,7 +154,6 @@ class CartController(object):
''' '''
self.cart.refresh_from_db() self.cart.refresh_from_db()
self._recalculate_discounts() self._recalculate_discounts()
@ -250,8 +247,6 @@ class CartController(object):
# Test each category limit here # Test each category limit here
for category in by_cat: for category in by_cat:
#ctrl = CategoryController(category)
#limit = ctrl.user_quantity_remaining(self.cart.user)
limit = with_remainders[category].remainder limit = with_remainders[category].remainder
# Get the amount so far in the cart # Get the amount so far in the cart

View file

@ -38,7 +38,6 @@ class CategoryController(object):
return set(i.category for i in available) return set(i.category for i in available)
@classmethod @classmethod
def attach_user_remainders(cls, user, categories): def attach_user_remainders(cls, user, categories):
''' '''

View file

@ -1,5 +1,3 @@
import itertools
from django.db.models import Case from django.db.models import Case
from django.db.models import F, Q from django.db.models import F, Q
from django.db.models import Sum from django.db.models import Sum
@ -9,8 +7,6 @@ from django.utils import timezone
from registrasion.models import commerce from registrasion.models import commerce
from registrasion.models import conditions from registrasion.models import conditions
from registrasion.models import inventory
_BIG_QUANTITY = 99999999 # A big quantity _BIG_QUANTITY = 99999999 # A big quantity
@ -134,8 +130,6 @@ class RemainderSetByFilter(object):
if hasattr(self.condition, "remainder"): if hasattr(self.condition, "remainder"):
return self.condition.remainder return self.condition.remainder
# Mark self.condition with a remainder # Mark self.condition with a remainder
qs = type(self.condition).objects.filter(pk=self.condition.id) qs = type(self.condition).objects.filter(pk=self.condition.id)
qs = self.pre_filter(qs, user) qs = self.pre_filter(qs, user)

View file

@ -50,7 +50,6 @@ class DiscountController(object):
categories and products. The discounts also list the available quantity categories and products. The discounts also list the available quantity
for this user, not including products that are pending purchase. ''' for this user, not including products that are pending purchase. '''
filtered_clauses = cls._filtered_discounts(user, categories, products) filtered_clauses = cls._filtered_discounts(user, categories, products)
discounts = [] discounts = []

View file

@ -58,7 +58,6 @@ class ProductController(object):
return out return out
@classmethod @classmethod
def attach_user_remainders(cls, user, products): def attach_user_remainders(cls, user, products):
''' '''

View file

@ -451,9 +451,6 @@ def _set_quantities_from_products_form(products_form, current_cart):
id__in=pks, id__in=pks,
).select_related("category") ).select_related("category")
# TODO: This is fundamentally dumb
product_quantities = [ product_quantities = [
(product, id_to_quantity[product.id]) for product in products (product, id_to_quantity[product.id]) for product in products
] ]