diff --git a/kallithea/config/routing.py b/kallithea/config/routing.py --- a/kallithea/config/routing.py +++ b/kallithea/config/routing.py @@ -573,7 +573,7 @@ def make_map(config): 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", diff --git a/kallithea/templates/admin/repos/repo_edit_advanced.html b/kallithea/templates/admin/repos/repo_edit_advanced.html --- a/kallithea/templates/admin/repos/repo_edit_advanced.html +++ b/kallithea/templates/admin/repos/repo_edit_advanced.html @@ -1,5 +1,5 @@

${_('Parent')}

-${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))}
${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")} diff --git a/kallithea/tests/functional/test_admin_repos.py b/kallithea/tests/functional/test_admin_repos.py --- a/kallithea/tests/functional/test_admin_repos.py +++ b/kallithea/tests/functional/test_admin_repos.py @@ -492,7 +492,7 @@ class _BaseTestCase(TestController): 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 @@ class _BaseTestCase(TestController): 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 @@ class _BaseTestCase(TestController): 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 @@ class _BaseTestCase(TestController): 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')