diff --git a/src/main/scala/gitbucket/core/controller/IndexController.scala b/src/main/scala/gitbucket/core/controller/IndexController.scala index ba3cfd8dc..6bc27515a 100644 --- a/src/main/scala/gitbucket/core/controller/IndexController.scala +++ b/src/main/scala/gitbucket/core/controller/IndexController.scala @@ -117,7 +117,9 @@ trait IndexControllerBase extends ControllerBase { * JSON API for checking user existence. */ post("/_user/existence")(usersOnly { - getAccountByUserName(params("userName")).isDefined + getAccountByUserName(params("userName")).map { account => + if(params.get("userOnly").isDefined) !account.isGroupAccount else true + } getOrElse false }) // TODO Move to RepositoryViwerController? diff --git a/src/main/twirl/gitbucket/core/admin/usergroup.scala.html b/src/main/twirl/gitbucket/core/admin/usergroup.scala.html index b9f61713a..ac8044d55 100644 --- a/src/main/twirl/gitbucket/core/admin/usergroup.scala.html +++ b/src/main/twirl/gitbucket/core/admin/usergroup.scala.html @@ -78,7 +78,8 @@ $(function(){ // check existence $.post('@path/_user/existence', { - 'userName': userName + 'userName': userName, + 'userOnly': true }, function(data, status){ if(data == 'true'){ addMemberHTML(userName, false);