Mercurial > kallithea
changeset 6093:062aa22363a1
routing: use POST to 'update_repo' instead of PUT
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 04 Aug 2016 14:23:36 +0200 |
parents | 5e0e297435a1 |
children | 10cda248d6f5 |
files | kallithea/config/routing.py kallithea/templates/admin/repos/repo_edit_settings.html kallithea/tests/functional/test_admin_repos.py |
diffstat | 3 files changed, 5 insertions(+), 5 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 @@ -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"]))
--- 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))} <div class="form"> <!-- fields --> <div class="fields">
--- 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,