`Delete user and contributions` action is missing for users that are a sole owner of a group

Summary

The Delete user and contributions action is missing for users that are a sole owner of a group. Furthermore the previous message saying that you can not soft delete a user that is a sole owner of a group until you transfer that group ownership to someone else. Previously this was the message:

Screen_Shot_2021-07-29_at_8.40.15_AM

This regression was introduced by !64648 (merged)

Steps to reproduce

  1. Visit a user that is the sole owner of a group
  2. Look in "User administration" dropdown menu. Notice the missing Delete user and contributions action.

What is the current bug behavior?

Delete user and contributions is missing for users that are a sole owner of a group.

Screen_Shot_2021-07-29_at_10.51.14_AM

What is the expected correct behavior?

Delete user and contributions action is available.

Screen_Shot_2021-07-29_at_10.43.59_AM

Output of checks

GitLab.com, GitLab Enterprise Edition 14.2.0-pre 859c8a0e18a

Workaround

Users that are the sole owner of a group can be deleted via the API with the hard_delete=true option

Edited by Peter Hegman