[Answer]-Deleting user from django, but preserving CMS pages

1👍

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.

Leave a comment