]> source.dussan.org Git - gitblit.git/commitdiff
Fix failure to save Allow Forks repository setting 43/243/1
authorJames Moger <james.moger@gitblit.com>
Thu, 5 Mar 2015 14:13:24 +0000 (09:13 -0500)
committerJames Moger <james.moger@gitblit.com>
Thu, 5 Mar 2015 14:13:24 +0000 (09:13 -0500)
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java

index d8dcdced9ac1dcad83d423e1dd46407babf1ed07..2c880247f95c70d2ddaf23e7fd8c26fb04908331 100644 (file)
@@ -26,8 +26,8 @@ import org.apache.wicket.markup.html.form.RadioGroup;
 import org.apache.wicket.markup.html.list.ListItem;\r
 import org.apache.wicket.markup.html.list.ListView;\r
 import org.apache.wicket.markup.html.panel.Fragment;\r
-import org.apache.wicket.model.IModel;\r
 import org.apache.wicket.model.Model;\r
+import org.apache.wicket.model.PropertyModel;\r
 \r
 import com.gitblit.Constants.AccessRestrictionType;\r
 import com.gitblit.Constants.AuthorizationControl;\r
@@ -51,8 +51,6 @@ public class AccessPolicyPanel extends BasePanel {
 \r
        private RadioGroup<AccessPolicy> policiesGroup;\r
 \r
-       private IModel<Boolean> allowForks;\r
-\r
        public AccessPolicyPanel(String wicketId, RepositoryModel repository) {\r
                this(wicketId, repository, null);\r
        }\r
@@ -146,13 +144,12 @@ public class AccessPolicyPanel extends BasePanel {
                }\r
                add(policiesGroup);\r
 \r
-               allowForks = Model.of(app().settings().getBoolean(Keys.web.allowForking, true));\r
-               if (allowForks.getObject()) {\r
+               if (app().settings().getBoolean(Keys.web.allowForking, true)) {\r
                        Fragment fragment = new Fragment("allowForks", "allowForksFragment", this);\r
                        fragment.add(new BooleanOption("allowForks",\r
                                getString("gb.allowForks"),\r
                                getString("gb.allowForksDescription"),\r
-                               allowForks));\r
+                               new PropertyModel<Boolean>(repository, "allowForks")));\r
                        add(fragment);\r
                } else {\r
                        add(new Label("allowForks").setVisible(false));\r
@@ -165,7 +162,6 @@ public class AccessPolicyPanel extends BasePanel {
                AccessPolicy policy = policiesGroup.getModelObject();\r
                repository.authorizationControl = policy.control;\r
                repository.accessRestriction = policy.type;\r
-               repository.allowForks = allowForks.getObject();\r
        }\r
 \r
        @Override\r