django-easy-audit icon indicating copy to clipboard operation
django-easy-audit copied to clipboard

Better handle transactions in pre-save

Open Etenil opened this issue 5 years ago • 3 comments
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.

Etenil avatar May 18 '20 06:05 Etenil

Interesting fix. Looks good.

Can you also add a test case?

jheld avatar May 19 '20 01:05 jheld

@jheld added test

Etenil avatar May 27 '20 08:05 Etenil

@Etenil can you check if the pre_save logic is still in need of change based on current master?

jheld avatar Aug 07 '20 19:08 jheld