diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-09 18:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-09 18:09:21 +0300 |
commit | d2675fa4de909714fcc6dc1bdd7bee9ce5e3af34 (patch) | |
tree | 0c0fbdd55fbb3a1616b10775113bf8320c9529c8 /app/models/group.rb | |
parent | 48d25238c386a89e8a6af218eeb290936a8f7595 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/group.rb')
-rw-r--r-- | app/models/group.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index 5369e873d17..aa810b62d7f 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -432,8 +432,9 @@ class Group < Namespace end # Check if user is a last owner of the group. + # Excludes project_bots def last_owner?(user) - has_owner?(user) && single_owner? + has_owner?(user) && all_owners_excluding_project_bots.size == 1 end def member_last_owner?(member) @@ -442,8 +443,8 @@ class Group < Namespace last_owner?(member.user) end - def single_owner? - members_with_parents.owners.size == 1 + def all_owners_excluding_project_bots + members_with_parents.owners.merge(User.without_project_bot) end def single_blocked_owner? |