Skip to content

Commit

Permalink
Cannot remove user that owns a project.
Browse files Browse the repository at this point in the history
Cannot remove user that owns a project.

Make lines shorter, set alert, use path instead of url.
  • Loading branch information
maxlazio authored and dosire committed Nov 16, 2012
1 parent 2ff36e7 commit 19e8473
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def update

def destroy
@admin_user = User.find(params[:id])
if @admin_user.my_own_projects.count > 0
redirect_to admin_users_path, alert: "User is a project owner and can't be removed." and return
end
@admin_user.destroy

respond_to do |format|
Expand Down

0 comments on commit 19e8473

Please sign in to comment.