changeset 6096:2aaa05ee969a

routing: use POST to 'update_user' instead of PUT
author Mads Kiilerich <madski@unity3d.com>
date Thu, 04 Aug 2016 14:23:36 +0200
parents 60bf1b171015
children 64b5ff4de45a
files kallithea/config/routing.py kallithea/controllers/admin/users.py kallithea/templates/admin/users/user_edit_profile.html kallithea/tests/functional/test_admin_users.py
diffstat 4 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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",
--- 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),
--- 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))}
 <div class="form">
         <div class="field">
            <div class="gravatar_box">
--- 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')