[manual] Use "subscriptions" for {add,list}_subscriptions consistently.

This change requires a zephyr_mirror deployment when it is pushed to prod.

(imported from commit a31d6efd2db4d4617c7c6b00326be3f07c7263da)
This commit is contained in:
Tim Abbott
2012-11-16 13:43:27 -05:00
parent afc62a8e16
commit f5ccde78e3
3 changed files with 6 additions and 5 deletions

View File

@@ -107,7 +107,7 @@ class HumbugAPI():
return self.do_api_query(request, "/api/v1/subscriptions/list")
def add_subscriptions(self, streams):
request = {'streams': streams}
request = {'subscriptions': streams}
return self.do_api_query(request, "/api/v1/subscriptions/add")
def call_on_each_message(self, callback, options = {}):

View File

@@ -67,7 +67,7 @@ exports.subscribe_for_send = function (stream, prompt_button) {
$.ajax({
type: 'POST',
url: '/json/subscriptions/add',
data: {"streams": JSON.stringify([stream]) },
data: {"subscriptions": JSON.stringify([stream]) },
dataType: 'json',
timeout: 10*60*1000, // 10 minutes in ms
success: function (response) {
@@ -90,7 +90,7 @@ function ajaxSubscribe(stream) {
type: "POST",
url: "/json/subscriptions/add",
dataType: 'json', // This seems to be ignored. We still get back an xhr.
data: {"streams": JSON.stringify([stream]) },
data: {"subscriptions": JSON.stringify([stream]) },
success: function (resp, statusText, xhr, form) {
if ($("#streams").val() === stream) {
$("#streams").val("");

View File

@@ -702,7 +702,7 @@ def gather_subscriptions(user_profile):
@authenticated_api_view
def api_list_subscriptions(request, user_profile):
return json_success({"streams": gather_subscriptions(user_profile)})
return json_success({"subscriptions": gather_subscriptions(user_profile)})
@authenticated_json_view
def json_list_subscriptions(request, user_profile):
@@ -733,7 +733,8 @@ def json_add_subscriptions(request, user_profile):
return add_subscriptions_backend(request, user_profile)
@has_request_variables
def add_subscriptions_backend(request, user_profile, streams_raw = POST('streams', simplejson.loads)):
def add_subscriptions_backend(request, user_profile,
streams_raw = POST('subscriptions', simplejson.loads)):
streams = []
for stream_name in streams_raw:
stream_name = stream_name.strip()