From: James Moger Date: Fri, 3 Feb 2012 22:23:10 +0000 (-0500) Subject: Prevent add/edit team with no selected repositories (issue 56) X-Git-Tag: v0.9.0~111 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2afc3115949c774bc6f35889f4e42439cc2106e0;p=gitblit.git Prevent add/edit team with no selected repositories (issue 56) --- diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index effc94f8..c8e9d197 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -14,6 +14,7 @@ #### fixes +- Prevent add/edit team with no selected repositories (issue 56) - Disallow browser autocomplete on add/edit user/team/repository pages - Fixed username case-sensitivity issues (issue 43) - Disregard searching a subfolder if Gitblit does not have filesystem permissions (Github/lemval issue 51) diff --git a/src/com/gitblit/wicket/pages/EditTeamPage.java b/src/com/gitblit/wicket/pages/EditTeamPage.java index 0af3cb4e..d78f889e 100644 --- a/src/com/gitblit/wicket/pages/EditTeamPage.java +++ b/src/com/gitblit/wicket/pages/EditTeamPage.java @@ -150,6 +150,10 @@ public class EditTeamPage extends RootSubPage { while (selectedRepositories.hasNext()) { repos.add(selectedRepositories.next().toLowerCase()); } + if (repos.size() == 0) { + error("A team must specify at least one repository."); + return; + } teamModel.repositories.clear(); teamModel.repositories.addAll(repos);