mirror of https://github.com/zulip/zulip.git
add_subscriptions_backend: Check that the argument is a list.
(imported from commit c514dab9fb28dcdaa12b38e7ef028e177f4377fb)
This commit is contained in:
parent
f5ccde78e3
commit
f1ccf44c99
|
@ -735,6 +735,9 @@ def json_add_subscriptions(request, user_profile):
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
def add_subscriptions_backend(request, user_profile,
|
def add_subscriptions_backend(request, user_profile,
|
||||||
streams_raw = POST('subscriptions', simplejson.loads)):
|
streams_raw = POST('subscriptions', simplejson.loads)):
|
||||||
|
if not isinstance(streams_raw, list):
|
||||||
|
return json_error("'subscriptions' argument must be a list")
|
||||||
|
|
||||||
streams = []
|
streams = []
|
||||||
for stream_name in streams_raw:
|
for stream_name in streams_raw:
|
||||||
stream_name = stream_name.strip()
|
stream_name = stream_name.strip()
|
||||||
|
|
Loading…
Reference in New Issue