Hmm found the original problem in satchmo/shop/models.py:

Had to change:

        if not alreadyInCart:
            signals.satchmo_cart_add_verify.send(self, cart=self,
cartitem=item_to_modify, added_quantity=number_added,
details=details)
            self.cartitem_set.add(item_to_modify)

...to:

        signals.satchmo_cart_add_verify.send(self, cart=self,
cartitem=item_to_modify, added_quantity=number_added,
details=details)
        if not alreadyInCart:
            self.cartitem_set.add(item_to_modify)


Will post again with results of the test for the race condition.

Chris



On Nov 24, 10:35 am, Johannes Berg <[email protected]> wrote:
> On Tue, 2009-11-24 at 06:56 -0800, Chris Hart wrote:
> > Django 1.0.3, Satchmo 0.8.1
>
> > For some reason we occasionally get orders that were allowed to take
> > more inventory than was available for certain products. We have the
> > correct setting in the store configuration and have added a custom
> > message asking customers to call in if there's not enough of something
> > and they would still like to backorder it.
>
> > All testing confirms that nobody can order more of something than is
> > available and yet we still see orders appearing that have caused items
> > to go into the negative.
>
> > Can anyone suggest what the best first steps to troubleshoot this
> > might be? Thanks,
>
> Sounds a bit like a race condition; try having a product with an
> inventory of 1, adding it to two different carts (different
> browsers/machines) and then checking out twice?
>
> johannes
>
>  signature.asc
> < 1KViewDownload

--

You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.


Reply via email to