If you delete a user from Django, then all related CMS-pages will be removed as well. E.g. when someone leaves the company, I don’t want his credentials available in the system, so deleting a user is the best option (only disabling the account is a bit of hassle if you have many users).
The pages being deleted as well when removing a user, is an undesired feature. Is there a (simple) way to work around this
If you delete a user from Django, then all related CMS-pages will be removed
Share
Why is disabling the account such a hassle, even with many users? You still have to find the user’s page in the admin to delete them, just like disabling.
1) You could also remove their privileges and/or revoke their admin access. All of these features are designed to do exactly what you want.
2) You could write a custom delete function that iterates over all pages connected to the CMS-user in question and sets their relation to said user to NULL, then deletes the User.
3) You could turn off foreign key checks at the database level.
4) And lastly, you could simply NOT delete the user. Deleting data is a bad idea — that’s why things like active flags exist. One day you might want to look back on that deleted user was up to and you’ll kick yourself if all of his records are simply gone.