Same problem, five years later. Someone knows how to deal with?
On Tuesday, December 2, 2014 at 12:55:14 PM UTC-2, Adam Fast wrote: > > Hi, > > I'm experimenting with Oscar and have this example ( > http://django-oscar.readthedocs.org/en/latest/howto/enforcing_stock_rules.html) > > set up in a project, but I'm not sure how to continue. By raising the > InvalidBasketLineError inside the signal (I currently have it set to fail > every time so I could experiment), it causes the site to 500. When adding a > product to the cart that gets me a 500 page ("InvalidBasketLineError at > /basket/add/4/"), when updating a quantity in an existing basket, since the > update is done with Javascript I get a page that hangs. > > How do I move forward with getting a user-friendly error here that > displays to the user the reason they're not allowed to purchase? Since the > documentation used an explicit exception with a message I expected that the > basket would be trapping that exception by default and making the provided > error message visible to the user (much as check_basket_is_valid does). Is > this an "old" method of doing this? Overriding > oscar.apps.checkout.session.CheckoutSessionMixin.check_basket_is_valid > works great for displaying errors about something the user has in their > basket, but it isn't used as early as possible (right upon add) to let the > user know there's an issue selling them what they've added so the line > signal example is still useful, I would imagine. > > Adam > > -- https://github.com/django-oscar/django-oscar http://django-oscar.readthedocs.org/en/latest/ https://twitter.com/django_oscar --- You received this message because you are subscribed to the Google Groups "django-oscar" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/django-oscar. To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/dc0cb0fd-5a4e-424a-8d9c-393557ab0d69%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.