Commit 00f5fe83 authored by Michal Čihař's avatar Michal Čihař

Remove temporary commit API

It is no longer needed since we have proper API for that.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent c66c777d
......@@ -293,22 +293,6 @@ BITBUCKET_PAYLOAD_WEBHOOK = r'''
class HooksViewTest(ViewTestCase):
@OverrideSettings(ENABLE_HOOKS=True)
@OverrideSettings(BACKGROUND_HOOKS=False)
def test_view_commit_hook_project(self):
response = self.client.get(
reverse('hook-commit-project', kwargs=self.kw_project)
)
self.assertContains(response, 'Commit performed')
@OverrideSettings(ENABLE_HOOKS=True)
@OverrideSettings(BACKGROUND_HOOKS=False)
def test_view_commit_hook_subproject(self):
response = self.client.get(
reverse('hook-commit-subproject', kwargs=self.kw_subproject)
)
self.assertContains(response, 'Commit performed')
@OverrideSettings(ENABLE_HOOKS=True)
@OverrideSettings(BACKGROUND_HOOKS=False)
def test_view_hook_project(self):
......@@ -434,14 +418,6 @@ class HooksViewTest(ViewTestCase):
self.assert_disabled()
def assert_disabled(self):
response = self.client.get(
reverse('hook-commit-project', kwargs=self.kw_project)
)
self.assertEqual(response.status_code, 405)
response = self.client.get(
reverse('hook-commit-subproject', kwargs=self.kw_subproject)
)
self.assertEqual(response.status_code, 405)
response = self.client.get(
reverse('hook-project', kwargs=self.kw_project)
)
......
......@@ -96,34 +96,6 @@ def perform_update(obj):
obj.do_update()
@csrf_exempt
def commit_subproject(request, project, subproject):
'''
API hook for updating git repos.
'''
if not appsettings.ENABLE_HOOKS:
return HttpResponseNotAllowed([])
obj = get_subproject(request, project, subproject, True)
if not obj.project.enable_hooks:
return HttpResponseNotAllowed([])
obj.commit_pending(request)
return hook_response('Commit performed')
@csrf_exempt
def commit_project(request, project):
'''
API hook for updating git repos.
'''
if not appsettings.ENABLE_HOOKS:
return HttpResponseNotAllowed([])
obj = get_project(request, project, True)
if not obj.enable_hooks:
return HttpResponseNotAllowed([])
obj.commit_pending(request)
return hook_response('Commit performed')
@csrf_exempt
def update_subproject(request, project, subproject):
'''
......
......@@ -479,16 +479,6 @@ urlpatterns = [
weblate.trans.views.api.update_project,
name='hook-project',
),
url(
r'^hooks/commit/' + SUBPROJECT + '$',
weblate.trans.views.api.commit_subproject,
name='hook-commit-subproject',
),
url(
r'^hooks/commit/' + PROJECT + '$',
weblate.trans.views.api.commit_project,
name='hook-commit-project',
),
url(
r'^hooks/github/$', weblate.trans.views.api.vcs_service_hook,
{'service': 'github'},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment