Cannot delete user who is in a group

Hey., @jomaxro, working with a hosted customer today we tried to delete a user.

There was a message that the user had posts and couldn’t be deleted, but there were no posts, but the user was in a group. When we deleted the user from group it was possible to delete the user.

Any chance you grabbed the logs from the failed deletion? I can try again, but last I tried on try I was able to successfully delete a user who was in a group on try.discourse.org.

Then it must have been gremlins.

I had that same issue:

https://meta.discourse.org/t/cannot-delete-user-make-sure-all-posts-are-deleted/25233/62?u=omarfilip

Yeah, but that’s SSO, so only the SSO master can delete users.

Hmm - could be. The user was created via SSO, but added to the group manually in Discourse. I was able to delete him only after removing him from the group.

BTW, the log is posted in the topic I linked.

Pretty sure I fixed this today. It happens when one of the groups the user belongs to grants a trust level.

https://github.com/discourse/discourse/commit/5ce817766253e91b77273dd15d443d739387b5fa

The order of dependent: destroy matters. :bulb:

14 Likes