Changeset - 2aaa05ee969a
[Not reviewed]
default
0 4 0
Mads Kiilerich - 9 years ago 2016-08-04 14:23:36
madski@unity3d.com
routing: use POST to 'update_user' instead of PUT
4 files changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/config/routing.py
Show inline comments
 
@@ -178,7 +178,7 @@ def make_map(config):
 
        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",
kallithea/controllers/admin/users.py
Show inline comments
 
@@ -173,7 +173,6 @@ class UsersController(BaseController):
 
                '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),
kallithea/templates/admin/users/user_edit_profile.html
Show inline comments
 
${h.form(url('update_user', id=c.user.user_id),method='put')}
 
${h.form(url('update_user', id=c.user.user_id))}
 
<div class="form">
 
        <div class="field">
 
           <div class="gravatar_box">
kallithea/tests/functional/test_admin_users.py
Show inline comments
 
@@ -152,7 +152,7 @@ class TestAdminUsersController(TestContr
 
                                          # 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')
 

	
0 comments (0 inline, 0 general)