# HG changeset patch # User Mads Kiilerich # Date 1470313416 -7200 # Node ID ad41c9a72a88521083f6f58d50ab5a1e5c164c80 # Parent 5e836bd9b5d46d0786781d2179310e19df678845 routing: use POST to 'delete_repo' instead of DELETE diff -r 5e836bd9b5d4 -r ad41c9a72a88 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 @@ -122,9 +122,8 @@ m.connect("put_repo", "/repos/{repo_name:.*?}", action="update", conditions=dict(method=["PUT"], function=check_repo)) - m.connect("delete_repo", "/repos/{repo_name:.*?}", - action="delete", conditions=dict(method=["DELETE"], - )) + m.connect("delete_repo", "/repos/{repo_name:.*?}/delete", + action="delete", conditions=dict(method=["POST"])) #ADMIN REPOSITORY GROUPS ROUTES with rmap.submapper(path_prefix=ADMIN_PREFIX, diff -r 5e836bd9b5d4 -r ad41c9a72a88 kallithea/templates/admin/repos/repo_edit_advanced.html --- 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 @@ -73,7 +73,7 @@ ${h.end_form()}

${_('Delete')}

-${h.form(url('delete_repo', repo_name=c.repo_name), method='delete')} +${h.form(url('delete_repo', repo_name=c.repo_name))}
- ${h.form(h.url('delete_repo', repo_name=repo_name), method='delete')} + ${h.form(h.url('delete_repo', repo_name=repo_name))} ${h.submit('remove_%s' % repo_name,_('Delete'),class_="action_button", onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} diff -r 5e836bd9b5d4 -r ad41c9a72a88 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 @@ -357,7 +357,7 @@ pytest.fail('no repo %s in filesystem' % repo_name) response = self.app.post(url('delete_repo', repo_name=repo_name), - params={'_method': 'delete', '_authentication_token': self.authentication_token()}) + params={'_authentication_token': self.authentication_token()}) self.checkSessionFlash(response, 'Deleted repository %s' % (repo_name)) @@ -409,7 +409,7 @@ pytest.fail('no repo %s in filesystem' % repo_name) response = self.app.post(url('delete_repo', repo_name=repo_name), - params={'_method': 'delete', '_authentication_token': self.authentication_token()}) + params={'_authentication_token': self.authentication_token()}) self.checkSessionFlash(response, 'Deleted repository %s' % (repo_name_unicode)) response.follow() @@ -427,7 +427,7 @@ def test_delete_browser_fakeout(self): response = self.app.post(url('delete_repo', repo_name=self.REPO), - params=dict(_method='delete', _authentication_token=self.authentication_token())) + params=dict(_authentication_token=self.authentication_token())) def test_show(self): self.log_user() diff -r 5e836bd9b5d4 -r ad41c9a72a88 kallithea/tests/functional/test_admin_users.py --- a/kallithea/tests/functional/test_admin_users.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/tests/functional/test_admin_users.py Thu Aug 04 14:23:36 2016 +0200 @@ -194,7 +194,7 @@ '%s' % (username, reponame)) response = self.app.post(url('delete_repo', repo_name=reponame), - params={'_method': 'delete', '_authentication_token': self.authentication_token()}) + params={'_authentication_token': self.authentication_token()}) self.checkSessionFlash(response, 'Deleted repository %s' % reponame) response = self.app.post(url('delete_user', id=new_user.user_id), diff -r 5e836bd9b5d4 -r ad41c9a72a88 kallithea/tests/functional/test_forks.py --- a/kallithea/tests/functional/test_forks.py Thu Aug 04 14:23:36 2016 +0200 +++ b/kallithea/tests/functional/test_forks.py Thu Aug 04 14:23:36 2016 +0200 @@ -85,7 +85,7 @@ # remove this fork response = self.app.post(url('delete_repo', repo_name=fork_name), - params={'_method': 'delete', '_authentication_token': self.authentication_token()}) + params={'_authentication_token': self.authentication_token()}) def test_fork_create_into_group(self): self.log_user()