Commit 927d0cc2674d21f470a29e7a10577707172f13c6
1 parent
8ec95642
Exists in
master
and in
4 other branches
Do not allow removal of a project owner user.
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
app/controllers/admin/users_controller.rb
... | ... | @@ -98,6 +98,7 @@ class Admin::UsersController < AdminController |
98 | 98 | |
99 | 99 | def destroy |
100 | 100 | @admin_user = User.find(params[:id]) |
101 | + redirect_to admin_users_url, notice: 'User is a project owner, cannot be removed.' and return if @admin_user.my_own_projects.count > 0 | |
101 | 102 | @admin_user.destroy |
102 | 103 | |
103 | 104 | respond_to do |format| | ... | ... |