# HG changeset patch # User Mads Kiilerich # Date 1470313416 -7200 # Node ID 062aa22363a11270b7b54ae83effa642d8806c7b # Parent 5e0e297435a15f558157514015b14f60756f9db4 routing: use POST to 'update_repo' instead of PUT diff -r 5e0e297435a1 -r 062aa22363a1 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 @@ -119,8 +119,8 @@ action="index", conditions=dict(method=["GET"])) m.connect("new_repo", "/create_repository", action="create_repository", conditions=dict(method=["GET"])) - m.connect("put_repo", "/repos/{repo_name:.*?}", - action="update", conditions=dict(method=["PUT"], + m.connect("update_repo", "/repos/{repo_name:.*?}", + action="update", conditions=dict(method=["POST"], function=check_repo)) m.connect("delete_repo", "/repos/{repo_name:.*?}/delete", action="delete", conditions=dict(method=["POST"])) diff -r 5e0e297435a1 -r 062aa22363a1 kallithea/templates/admin/repos/repo_edit_settings.html --- a/kallithea/templates/admin/repos/repo_edit_settings.html Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/templates/admin/repos/repo_edit_settings.html Thu Aug 04 14:23:36 2016 +0200 @@ -1,4 +1,4 @@ -${h.form(url('put_repo', repo_name=c.repo_info.repo_name), method='put')} +${h.form(url('update_repo', repo_name=c.repo_info.repo_name))}
diff -r 5e0e297435a1 -r 062aa22363a1 kallithea/tests/functional/test_admin_repos.py --- a/kallithea/tests/functional/test_admin_repos.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/tests/functional/test_admin_repos.py Thu Aug 04 14:23:36 2016 +0200 @@ -444,7 +444,7 @@ assert perm[0].permission.permission_name == 'repository.read' assert Repository.get_by_repo_name(self.REPO).private == False - response = self.app.put(url('put_repo', repo_name=self.REPO), + response = self.app.post(url('update_repo', repo_name=self.REPO), fixture._get_repo_create_params(repo_private=1, repo_name=self.REPO, repo_type=self.REPO_TYPE, @@ -459,7 +459,7 @@ assert len(perm), 1 assert perm[0].permission.permission_name == 'repository.none' - response = self.app.put(url('put_repo', repo_name=self.REPO), + response = self.app.post(url('update_repo', repo_name=self.REPO), fixture._get_repo_create_params(repo_private=False, repo_name=self.REPO, repo_type=self.REPO_TYPE,