Changeset - c9a62db774c5
[Not reviewed]
0 1 0
Christopher Neugebauer - 8 years ago 2016-04-06 07:02:11
chrisjrn@gmail.com
Resolves #17 - cannot generate invoice if there are no product items
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
registrasion/controllers/invoice.py
Show inline comments
...
 
@@ -67,8 +67,11 @@ class InvoiceController(object):
 
        )
 
        invoice.save()
 

	
 
        # TODO: calculate line items.
 
        product_items = rego.ProductItem.objects.filter(cart=cart)
 

	
 
        if len(product_items) == 0:
 
            raise ValidationError("Your cart is empty.")
 

	
 
        product_items = product_items.order_by(
 
            "product__category__order", "product__order"
 
        )
0 comments (0 inline, 0 general)