# HG changeset patch # User Mads Kiilerich # Date 1470313416 -7200 # Node ID 2aaa05ee969a13f548d8b075fc9a44070f63184c # Parent 60bf1b171015ea4d0b9e3f698cf1e5e1f7a43f23 routing: use POST to 'update_user' instead of PUT diff -r 60bf1b171015 -r 2aaa05ee969a 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 @@ -178,7 +178,7 @@ m.connect("new_user", "/users/new", action="new", conditions=dict(method=["GET"])) m.connect("update_user", "/users/{id}", - action="update", conditions=dict(method=["PUT"])) + action="update", conditions=dict(method=["POST"])) m.connect("delete_user", "/users/{id}/delete", action="delete", conditions=dict(method=["POST"])) m.connect("edit_user", "/users/{id}/edit", diff -r 60bf1b171015 -r 2aaa05ee969a kallithea/controllers/admin/users.py --- a/kallithea/controllers/admin/users.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/controllers/admin/users.py Thu Aug 04 14:23:36 2016 +0200 @@ -173,7 +173,6 @@ 'create_repo_perm': user_model.has_perm(id, 'hg.create.repository'), 'fork_repo_perm': user_model.has_perm(id, 'hg.fork.repository'), - '_method': 'put' }) return htmlfill.render( self._render_edit_profile(user), diff -r 60bf1b171015 -r 2aaa05ee969a kallithea/templates/admin/users/user_edit_profile.html --- a/kallithea/templates/admin/users/user_edit_profile.html Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/templates/admin/users/user_edit_profile.html Thu Aug 04 14:23:36 2016 +0200 @@ -1,4 +1,4 @@ -${h.form(url('update_user', id=c.user.user_id),method='put')} +${h.form(url('update_user', id=c.user.user_id))}
diff -r 60bf1b171015 -r 2aaa05ee969a kallithea/tests/functional/test_admin_users.py --- a/kallithea/tests/functional/test_admin_users.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/tests/functional/test_admin_users.py Thu Aug 04 14:23:36 2016 +0200 @@ -152,7 +152,7 @@ # so we use creation data params.update({'_authentication_token': self.authentication_token()}) - response = self.app.put(url('user', id=usr.user_id), params) + response = self.app.post(url('update_user', id=usr.user_id), params) self.checkSessionFlash(response, 'User updated successfully') params.pop('_authentication_token')