django-easy-audit
django-easy-audit copied to clipboard
Better handle transactions in pre-save
trafficstars
The pre-save hook makes the assumption that a PK that is set denotes a model update. In transactions it can happen that a PK is defined however the model isn't actually saved yet. The current code causes an error in these conditions.
Interesting fix. Looks good.
Can you also add a test case?
@jheld added test
@Etenil can you check if the pre_save logic is still in need of change based on current master?