1👍
Instead of:
blah = Blah(user=get_user_model(), name="None")
Just use:
blah = Blah(user=kwargs["instance"], name="None")
That’s because Blah()
expects an instance, not the class model.
A signal receiver always has sender
as the first argument, and then a number of variable arguments (that’s why the *kwargs
is required) as explained in the signals documentation. The list of post-save
arguments can be found in the post-save documentation.
Source:stackexchange.com