summaryrefslogtreecommitdiffstats
path: root/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java')
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
index 9fa9b52af1..3aed95d07b 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
@@ -114,11 +114,16 @@ public class PutConfig implements RestModifyView<ProjectResource, Input> {
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<ProjectResource, Input> {
}
if (input.pluginConfigValues != null) {
- setPluginConfigValues(rsrc.getControl().getProjectState(),
+ setPluginConfigValues(ctrl.getProjectState(),
projectConfig, input.pluginConfigValues);
}