mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
Prohibit creating two views with the same name.
http://d.hatena.ne.jp/ssogabe/20090101/1230744150 git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14067 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
17cecbc66b
commit
c5a4e8c463
3 files changed
+38
-2
No files matched your search
@@ -531,7 +531,10 @@ public abstract class View extends AbstractModelObject implements AccessControll
|
||||
public static View create(StaplerRequest req, StaplerResponse rsp, ViewGroup owner) throws ParseException, FormException, IOException, ServletException {
|
||||
req.setCharacterEncoding("UTF-8");
|
||||
|
||||
checkGoodName(req.getParameter("name"));
|
||||
String name = req.getParameter("name");
|
||||
checkGoodName(name);
|
||||
if(owner.getView(name)!=null)
|
||||
throw new FormException(Messages.Hudson_ViewAlreadyExists(name),"name");
|
||||
|
||||
// create a view
|
||||
View v = LIST.findByName(req.getParameter("mode")).newInstance(req,req.getSubmittedForm());
|
||||
|
||||
Reference in new issue
Block a user