Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Deleting orders fails when stock app isn't included in INSTALLED_APPS #27
If I have the settings as:
INSTALLED_APPS = ( ... 'plata.discount', 'plata.payment', 'plata.product', 'plata.shop', ...
Then deleting orders fails:
If I add
oh, sorry, I've hit the submit button a bit too early....
To me it seems that the ForeignKey from StockTransaction to OrderPayment is the culprit. When Django's doing it's magic when deleting objects it encounters StockTransaction somehow regardless of the PLATA_STOCK_TRACKING setting.
It should not have any side effects beneath the addition of two database
I'd still like to know why you are seeing this particular problem. I hope
Thanks for the feedback! I'll try it with
The problem is a bit weird to reproduce. It occurs in some of our testing instances from time to time, but I was not able to reproduce it on a development machine or even to repeat the behavior on a testing machine after it occurred. But I keep an eye on it and hope to come up with some more information when this happens, especially how Django comes to the conclusion, that it has to look at the stock model at some point.
The only place I found where the stock models are imported if
The bug can be triggered by importing
I'm not sure whether there is an easy way to fix the problem without patching Django first. Maybe make the period and stock transaction model abstract?