fix
This commit is contained in:
parent
3668001c9f
commit
dcb48ab0c7
@ -375,14 +375,16 @@ def cart(request):
|
||||
if not user.is_authenticated:
|
||||
return HttpResponse("[]")
|
||||
cart = []
|
||||
try:
|
||||
for product in CartProduct.objects.filter(cart=user.cart):
|
||||
cart.append({
|
||||
"id": product.product.id,
|
||||
"name": product.product.name,
|
||||
"quantity": product.quantity,
|
||||
"price": product.price,
|
||||
"price": product.product.price,
|
||||
"img": product.product.img.url,
|
||||
})
|
||||
except AttributeError:
|
||||
return HttpResponse("[]")
|
||||
return HttpResponse(json.dumps(cart))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user