diff --git a/humbug/urls.py b/humbug/urls.py index d9083ca61e..7b52c39b0c 100644 --- a/humbug/urls.py +++ b/humbug/urls.py @@ -173,7 +173,7 @@ v1_api_and_json_patterns = patterns('zephyr.views', url(r'^bots/(?P.*)/api_key/regenerate$', 'rest_dispatch', {'POST': 'regenerate_bot_api_key'}), url(r'^bots/(?P.*)$', 'rest_dispatch', - {'PATCH': 'patch_bot_backend'}), + {'POST': 'update_bot_backend'}), url(r'^register$', 'rest_dispatch', {'POST': 'api_events_register'}), url(r'^messages/latest$', 'rest_dispatch', diff --git a/static/js/settings.js b/static/js/settings.js index 6c4126cba6..5a718b507f 100644 --- a/static/js/settings.js +++ b/static/js/settings.js @@ -172,7 +172,7 @@ $(function () { edit_button.hide(); $.ajax({ url: '/json/bots/' + encodeURIComponent(email), - type: 'PATCH', + type: 'POST', data: formData, cache: false, processData: false, diff --git a/zephyr/tests.py b/zephyr/tests.py index b613853999..c304048391 100644 --- a/zephyr/tests.py +++ b/zephyr/tests.py @@ -590,7 +590,7 @@ class BotTest(AuthedTestCase): bot_info = { 'full_name': 'Fred', } - result = self.client_patch("/json/bots/hambot-bot@zulip.com", bot_info) + result = self.client.post("/json/bots/hambot-bot@zulip.com", bot_info) self.assert_json_error(result, 'Insufficient permission') def get_bot(self): @@ -621,7 +621,7 @@ class BotTest(AuthedTestCase): bot_info = { 'full_name': 'Fred', } - result = self.client_patch("/json/bots/hambot-bot@zulip.com", bot_info) + result = self.client.post("/json/bots/hambot-bot@zulip.com", bot_info) self.assert_json_success(result) full_name = ujson.loads(result.content)['full_name'] @@ -637,7 +637,7 @@ class BotTest(AuthedTestCase): bot_info = { 'full_name': 'Fred', } - result = self.client_patch("/json/bots/nonexistent-bot@zulip.com", bot_info) + result = self.client.post("/json/bots/nonexistent-bot@zulip.com", bot_info) self.assert_json_error(result, 'No such user') self.assert_num_bots_equal(1) diff --git a/zephyr/views.py b/zephyr/views.py index c1a396c665..0c2d221d6e 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -2027,7 +2027,7 @@ def deactivate_user_backend(request, user_profile, email): return json_success({}) @has_request_variables -def patch_bot_backend(request, user_profile, email, full_name=REQ): +def update_bot_backend(request, user_profile, email, full_name=REQ): # TODO: # 1) Validate data # 2) Support avatar changes