diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/CreateProject.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/CreateProject.java index 37ab506a91..e69b62cf9d 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/CreateProject.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/CreateProject.java @@ -147,7 +147,7 @@ public class CreateProject implements RestModifyView { public ConfigInfo apply(ProjectResource rsrc, Input input) throws ResourceNotFoundException, BadRequestException, ResourceConflictException { - Project.NameKey projectName = rsrc.getNameKey(); if (!rsrc.getControl().isOwner()) { - throw new ResourceNotFoundException(projectName.get()); + throw new ResourceNotFoundException(rsrc.getName()); } + return apply(rsrc.getControl(), input); + } + public ConfigInfo apply(ProjectControl ctrl, Input input) + throws ResourceNotFoundException, BadRequestException, + ResourceConflictException { + Project.NameKey projectName = ctrl.getProject().getNameKey(); if (input == null) { throw new BadRequestException("config is required"); } @@ -163,7 +168,7 @@ public class PutConfig implements RestModifyView { } if (input.pluginConfigValues != null) { - setPluginConfigValues(rsrc.getControl().getProjectState(), + setPluginConfigValues(ctrl.getProjectState(), projectConfig, input.pluginConfigValues); }