I tried to delete a user in the Django admin panel and got an error that my user (Django admin) cannot delete the outstanding token of the user to be deleted. There is a list of outstanding token and I can see the user to be deleted has one. Is this is known issue? A limitation? Any workaround?
It is a known feature of Django, it stops you from deleting objects that are linked by mistake.
The best way to this is ask the user to remove the user themselves. Alternatively, if that is not possible, you can use the django shell, get the user object you are trying to delete by id, and then calling the cancel method of that user object.
Lastly, if none of the above is possible, you can override the password of that user from the Django Admin, and then log in as that user and delete the user as they would.
Charlie: the self registered user are not created as super admin( with taiga-manage.sh) so they cannot login to the Django admin panel. I noticed that I need to create the user with createsuperuser(if there is a way to upgrade a registered user to an superuser I’d like to know)
David: Thanks for the info. I tried it and I was not able to delete the user but I noticed the outstanding token will expire on may 9th. So I’ll retry after this date.
I have use taiga-manage.sh (not manage.py) to remove the expired tokens because I’m running Taiga in Docker.
The user can perform the deletion without going to the Django-admin. They need to go to their profile from Taiga and then click on Delete taiga account.