Open juandaherrera opened 8 months ago
I'm late to the party on this one, but maybe still relevant...
It looks like django-soft-delete package is trying to soft delete related objects, but the signal you’ve set up (update_account_balance) is causing an error when the related object (Transaction) is being accessed after it’s already been marked for deletion.
Possible Solutions:
These steps should help avoid the DoesNotExist exception you’re seeing when deleting the account with related transactions.
It might also be helpful to share the source of the signals.py
file as well.
This is my BaseModel:
This is the model I want to delete:
This is the model that has an Account as ForeignKey:
When I have a transaction associated with an account and try to delete that account from the admin, I get the following error:
What's strange is that, when I first delete the transaction and then delete the account, there's no problem.
I'm using the
1.0.12
version ofdjango-soft-delete