# HG changeset patch # User Mads Kiilerich # Date 1470313416 -7200 # Node ID 1522c37cbc62d7c09198a247525eb7477754807b # Parent e1783bfc008285ec8511d05e90611e34244d6008 routing: use POST to 'update_users_group' instead of PUT diff -r e1783bfc0082 -r 1522c37cbc62 kallithea/config/routing.py --- a/kallithea/config/routing.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/config/routing.py Thu Aug 04 14:23:36 2016 +0200 @@ -224,7 +224,7 @@ m.connect("new_users_group", "/user_groups/new", action="new", conditions=dict(method=["GET"])) m.connect("update_users_group", "/user_groups/{id}", - action="update", conditions=dict(method=["PUT"])) + action="update", conditions=dict(method=["POST"])) m.connect("delete_users_group", "/user_groups/{id}/delete", action="delete", conditions=dict(method=["POST"])) m.connect("edit_users_group", "/user_groups/{id}/edit", diff -r e1783bfc0082 -r 1522c37cbc62 kallithea/controllers/admin/user_groups.py --- a/kallithea/controllers/admin/user_groups.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/controllers/admin/user_groups.py Thu Aug 04 14:23:36 2016 +0200 @@ -194,7 +194,6 @@ 'hg.create.repository'), 'fork_repo_perm': ug_model.has_perm(id, 'hg.fork.repository'), - '_method': 'put' }) return htmlfill.render( diff -r e1783bfc0082 -r 1522c37cbc62 kallithea/templates/admin/user_groups/user_group_edit_settings.html --- a/kallithea/templates/admin/user_groups/user_group_edit_settings.html Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/templates/admin/user_groups/user_group_edit_settings.html Thu Aug 04 14:23:36 2016 +0200 @@ -1,4 +1,4 @@ -${h.form(url('users_group', id=c.user_group.users_group_id),method='put', id='edit_users_group')} +${h.form(url('update_users_group', id=c.user_group.users_group_id), id='edit_users_group')}
diff -r e1783bfc0082 -r 1522c37cbc62 kallithea/tests/functional/test_admin_user_groups.py --- a/kallithea/tests/functional/test_admin_user_groups.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/tests/functional/test_admin_user_groups.py Thu Aug 04 14:23:36 2016 +0200 @@ -32,11 +32,11 @@ response = self.app.get(url('new_users_group')) def test_update(self): - response = self.app.put(url('users_group', id=1), status=403) + response = self.app.post(url('update_users_group', id=1), status=403) def test_update_browser_fakeout(self): - response = self.app.post(url('users_group', id=1), - params=dict(_method='put', _authentication_token=self.authentication_token())) + response = self.app.post(url('update_users_group', id=1), + params=dict(_authentication_token=self.authentication_token())) def test_delete(self): self.log_user()