Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Custom Application related objects contains swapped out instance #90
We have been experiencing errors while trying to delete a user when a custom Application has been enabled. I have investigated the issue and found out that django mimics the db CASCADE delete behavior by manually trying to determine the objects it needs to delete. For this it uses the
Django has solved this problem for its own custom user model by introducing a private api in the form of a Meta class argument: swappable. This takes the name of a setting which points to the newly swapped model (like AUTH_USER_MODEL).
The solution for django-oauth-toolkit would be to add swappable to the Application model but this means we need a new non-namespaced setting. Furthermore this will not work in 1.4 and I don't see any way to fix it for that version.
I have most of the code ready and tested and will open a pull request asap.