summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Kempin <edwin.kempin@sap.com>2013-10-15 16:33:28 +0200
committerShawn Pearce <sop@google.com>2013-10-16 11:31:38 -0700
commitbb23f0fe3f1b4ed449221d5f9e1a8c31c9bf241d (patch)
tree912a003ab093456b71621c0f1a7acfd7ae88d8ca
parentacf2f29b5ca6c95da16fd3ee37571219231c1ffb (diff)
Fix updating of project options
The REST endpoint that updates the project option is supposed to return the updated project options, however at the moment it returns the project options as they were before the update. As result after changing the project options in the WebUI one needs to refresh the screen in order to see the new values. The problem was that ProjectControl was created for the project with the old values and after the configuration was updated, this old project control instance with the outdated project instance was used to create the project options that are returned. Change-Id: Ib3b94639364ef1ddb96772989937043c4251a30f Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java6
1 files changed, 4 insertions, 2 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 1918a03d0b..f105087807 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
@@ -139,8 +139,10 @@ public class PutConfig implements RestModifyView<ProjectResource, Input> {
throw new ResourceConflictException("Cannot update " + projectName);
}
}
- return new ConfigInfo(rsrc.getControl(),
- projectStateFactory.create(projectConfig),
+
+ ProjectState state = projectStateFactory.create(projectConfig);
+ return new ConfigInfo(
+ state.controlFor(currentUser.get()), state,
config, views, currentUser);
} catch (ConfigInvalidException err) {
throw new ResourceConflictException("Cannot read project " + projectName, err);