You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In TMS we have an Order model which has multiple Activities.
In the Order model, we define some constraints about the Activities.
When we do a MultiPUT on /api/order, we cannot control the order in which the models are saved.
It can occur that the Order model is saved before the Activity models, this causes Order.clean to be fired prematurely: the order.activities will contain the old version of the activities.
When the activities themselves are saved, the Order.clean isn't called afterwards and we are left with data which is invalid by our constraints.
In TMS we have an Order model which has multiple Activities.
In the Order model, we define some constraints about the Activities.
When we do a MultiPUT on /api/order, we cannot control the order in which the models are saved.
It can occur that the Order model is saved before the Activity models, this causes Order.clean to be fired prematurely: the order.activities will contain the old version of the activities.
When the activities themselves are saved, the Order.clean isn't called afterwards and we are left with data which is invalid by our constraints.
A failing testcase of this behavior can be found here:
https://bitbucket.org/codeyellow/tms/src/ed1f0b7c4ef3071911b856a9ea47abf9d8818385/backend/commerce/tests/test_order.py?fileviewer=file-view-default#test_order.py-177
The text was updated successfully, but these errors were encountered: