Skip to content

Commit

Permalink
Merge pull request #233 from sephii/cart-items-order
Browse files Browse the repository at this point in the history
make order of the items in the cart deterministic
  • Loading branch information
chrisglass committed Jun 6, 2013
2 parents ce22fa3 + 5f81f59 commit 92b2446
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shop/models_bases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def update(self, request):
from shop.models import CartItem, Product

# This is a ghetto "select_related" for polymorphic models.
items = CartItem.objects.filter(cart=self)
items = CartItem.objects.filter(cart=self).order_by('pk')
product_ids = [item.product_id for item in items]
products = Product.objects.filter(pk__in=product_ids)
products_dict = dict([(p.pk, p) for p in products])
Expand Down

0 comments on commit 92b2446

Please sign in to comment.