Skip to content

Conversation

@mschoettle
Copy link
Contributor

@mschoettle mschoettle commented Sep 13, 2024

If the model changes are committed in a transaction, at the time when the post delete signal is handled instance.pk returns None.

This PR changes the logic such that the instance ID is retrieved before this happens, so that it is available when the event is logged and the CRUDEvent created.

Fixes #307

@mschoettle mschoettle changed the title fix: properly handle post delete in transactions Properly handle post delete in transactions Sep 14, 2024
@mschoettle mschoettle marked this pull request as ready for review September 14, 2024 00:55
If the model changes are committed in a transaction,
at the time when the post delete signal is handled
instance.pk returns None.

Store the instance's ID beforehand so that it is available
when creating the CRUDEvent.
@jheld jheld merged commit 5888702 into soynatan:master Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deleting a model: post_delete exception on CRUDEvent creation: object_id cannot be null

2 participants