Merge pull request #1651 from dosire/user_can_be_removed_if_its_not_a_project_owner

Do not allow removal of a project owner user.
This commit is contained in:
Valeriy Sizov 2012-10-08 05:42:47 -07:00
commit fc3c0592db

View file

@ -98,6 +98,7 @@ class Admin::UsersController < AdminController
def destroy
@admin_user = User.find(params[:id])
redirect_to admin_users_url, notice: 'User is a project owner, cannot be removed.' and return if @admin_user.my_own_projects.count > 0
@admin_user.destroy
respond_to do |format|