It should be impossible to delete the last admin

It's good, that as an admin, you cannot downgrade yourself to a non-admin while logged in. Although it is possible to delete your profile. If you've been the last admin, that's pretty bad.

Sure, fixing this is possible using the console:

user = User.where(username: "john").first
user.admin = true
user.save!

But still, GitLab should prevent the last admin from deleting it's account. It should enforce him to make another user admin or to create a new admin user.

I realized, that the username admin is preserved, but it seems that this is not a real user. Or is there such a user that can be used, to create a new admin account?

Running the reconfiguration does also not help to bring the root user back, once he was deleted.

Assignee Loading
Time tracking Loading