- does the product exist?
Yes,
- is the cart_item really not created? (or is the cart the thing not being created?)
The cartItem is created, but it shown if I request again the url
1) request: /cart/?add=productslug
2) response: without the new item
3) request : /cart/
4) response: the item now is shown
- are you using transactions?
No
- is the prefetch_related pre-caching the related cart items, so in the template it doesn't see the new item? (hint: redirect to the same page to load the page again)
I did not know that about prefetch_related, I have removed it and now working as expected.
also, while you're upgrading (or after), you can now use simpler code for that last line:return render(request, 'products/cart.html', response_args)
Thanks :)
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/91a72f12-14ab-4a38-b750-02b67cd6b16f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment