diff --git a/src/main/scala/gitbucket/core/controller/IndexController.scala b/src/main/scala/gitbucket/core/controller/IndexController.scala index ba3cfd8..6bc2751 100644 --- a/src/main/scala/gitbucket/core/controller/IndexController.scala +++ b/src/main/scala/gitbucket/core/controller/IndexController.scala @@ -117,7 +117,9 @@ * 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 b9f6171..ac8044d 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 @@ // check existence $.post('@path/_user/existence', { - 'userName': userName + 'userName': userName, + 'userOnly': true }, function(data, status){ if(data == 'true'){ addMemberHTML(userName, false);