Mercurial > kallithea
changeset 6098:caf71e50a070
routing: use POST to 'edit_repo_advanced_fork' instead of PUT
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 04 Aug 2016 14:23:36 +0200 |
parents | 64b5ff4de45a |
children | bf639e54292e |
files | kallithea/config/routing.py kallithea/templates/admin/repos/repo_edit_advanced.html kallithea/tests/functional/test_admin_repos.py |
diffstat | 3 files changed, 6 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 @@ -573,7 +573,7 @@ rmap.connect("edit_repo_advanced_fork", "/{repo_name:.*?}/settings/advanced/fork", controller='admin/repos', action="edit_advanced_fork", - conditions=dict(method=["PUT"], function=check_repo)) + conditions=dict(method=["POST"], function=check_repo)) rmap.connect("edit_repo_caches", "/{repo_name:.*?}/settings/caches",
--- a/kallithea/templates/admin/repos/repo_edit_advanced.html Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/templates/admin/repos/repo_edit_advanced.html Thu Aug 04 14:23:36 2016 +0200 @@ -1,5 +1,5 @@ <h3>${_('Parent')}</h3> -${h.form(url('edit_repo_advanced_fork', repo_name=c.repo_info.repo_name), method='put')} +${h.form(url('edit_repo_advanced_fork', repo_name=c.repo_info.repo_name))} <div class="form"> ${h.select('id_fork_of','',c.repos_list,class_="medium")} ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('Set'),class_="btn btn-small")}
--- 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 @@ -492,7 +492,7 @@ fixture.create_repo(other_repo, repo_type=self.REPO_TYPE) repo = Repository.get_by_repo_name(self.REPO) repo2 = Repository.get_by_repo_name(other_repo) - response = self.app.put(url('edit_repo_advanced_fork', repo_name=self.REPO), + response = self.app.post(url('edit_repo_advanced_fork', repo_name=self.REPO), params=dict(id_fork_of=repo2.repo_id, _authentication_token=self.authentication_token())) repo = Repository.get_by_repo_name(self.REPO) repo2 = Repository.get_by_repo_name(other_repo) @@ -513,7 +513,7 @@ self.log_user() repo = Repository.get_by_repo_name(self.REPO) repo2 = Repository.get_by_repo_name(self.OTHER_TYPE_REPO) - response = self.app.put(url('edit_repo_advanced_fork', repo_name=self.REPO), + response = self.app.post(url('edit_repo_advanced_fork', repo_name=self.REPO), params=dict(id_fork_of=repo2.repo_id, _authentication_token=self.authentication_token())) repo = Repository.get_by_repo_name(self.REPO) repo2 = Repository.get_by_repo_name(self.OTHER_TYPE_REPO) @@ -523,7 +523,7 @@ def test_set_fork_of_none(self): self.log_user() ## mark it as None - response = self.app.put(url('edit_repo_advanced_fork', repo_name=self.REPO), + response = self.app.post(url('edit_repo_advanced_fork', repo_name=self.REPO), params=dict(id_fork_of=None, _authentication_token=self.authentication_token())) repo = Repository.get_by_repo_name(self.REPO) repo2 = Repository.get_by_repo_name(self.OTHER_TYPE_REPO) @@ -535,7 +535,7 @@ def test_set_fork_of_same_repo(self): self.log_user() repo = Repository.get_by_repo_name(self.REPO) - response = self.app.put(url('edit_repo_advanced_fork', repo_name=self.REPO), + response = self.app.post(url('edit_repo_advanced_fork', repo_name=self.REPO), params=dict(id_fork_of=repo.repo_id, _authentication_token=self.authentication_token())) self.checkSessionFlash(response, 'An error occurred during this operation')