changeset 6105:1522c37cbc62

routing: use POST to 'update_users_group' instead of PUT
author Mads Kiilerich <madski@unity3d.com>
date Thu, 04 Aug 2016 14:23:36 +0200
parents e1783bfc0082
children abd734dc3704
files kallithea/config/routing.py kallithea/controllers/admin/user_groups.py kallithea/templates/admin/user_groups/user_group_edit_settings.html kallithea/tests/functional/test_admin_user_groups.py
diffstat 4 files changed, 5 insertions(+), 6 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
@@ -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",
--- 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(
--- 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')}
     <div class="form">
         <!-- fields -->
             <div class="fields">
--- 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()