summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2015-03-05 09:13:24 -0500
committerJames Moger <james.moger@gitblit.com>2015-03-05 09:13:24 -0500
commitedd8d3769d323ebd1ba08e6be3fa2f824b87fc08 (patch)
tree66244c36365a6772481c145b2fa260d84148da99 /src
parent006651e6002feadc940066633290fb15d526c3b0 (diff)
downloadgitblit-edd8d3769d323ebd1ba08e6be3fa2f824b87fc08.tar.gz
gitblit-edd8d3769d323ebd1ba08e6be3fa2f824b87fc08.zip
Fix failure to save Allow Forks repository setting
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
index d8dcdced..2c880247 100644
--- a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
@@ -26,8 +26,8 @@ import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Fragment;
-import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Constants.AuthorizationControl;
@@ -51,8 +51,6 @@ public class AccessPolicyPanel extends BasePanel {
private RadioGroup<AccessPolicy> policiesGroup;
- private IModel<Boolean> allowForks;
-
public AccessPolicyPanel(String wicketId, RepositoryModel repository) {
this(wicketId, repository, null);
}
@@ -146,13 +144,12 @@ public class AccessPolicyPanel extends BasePanel {
}
add(policiesGroup);
- allowForks = Model.of(app().settings().getBoolean(Keys.web.allowForking, true));
- if (allowForks.getObject()) {
+ if (app().settings().getBoolean(Keys.web.allowForking, true)) {
Fragment fragment = new Fragment("allowForks", "allowForksFragment", this);
fragment.add(new BooleanOption("allowForks",
getString("gb.allowForks"),
getString("gb.allowForksDescription"),
- allowForks));
+ new PropertyModel<Boolean>(repository, "allowForks")));
add(fragment);
} else {
add(new Label("allowForks").setVisible(false));
@@ -165,7 +162,6 @@ public class AccessPolicyPanel extends BasePanel {
AccessPolicy policy = policiesGroup.getModelObject();
repository.authorizationControl = policy.control;
repository.accessRestriction = policy.type;
- repository.allowForks = allowForks.getObject();
}
@Override