Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle post delete in transactions #308

Merged
merged 1 commit into from
Oct 9, 2024

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
11 checks passed
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