提交 19e8473e 编写于 作者: M Marin Jankovski 提交者: Sytse Sijbrandij

Cannot remove user that owns a project.

Cannot remove user that owns a project.

Make lines shorter, set alert, use path instead of url.
上级 2ff36e74
......@@ -98,6 +98,9 @@ class Admin::UsersController < AdminController
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|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册