I am trying to make a destructor-similar signal in django to be called before any children of the class Base are deleted. The reason is that I need to change something on another models's field when this is deleted as part of cleaning up, and I want this to run when for example deleting the instance from Admin.
I have this in my models.py:
@receiver(pre_delete, sender = Base)
def delete_shot_script(sender, instance, **kwargs):
print("Calling the destructor")
do_something...
I am getting the error ValueError: Signal receivers must accept keyword arguments (**kwargs), why?
Is the approach valid otherwise?
I have tried adding **kwargs, but the error seems to persist.