Use @has_request_variables in json_remove_subscription.

(imported from commit b08b7672959f8773db1ff7e40b53648926b47a09)
This commit is contained in:
Tim Abbott
2012-11-15 11:36:20 -05:00
parent 1c0832583c
commit 00cd30ff97

View File

@@ -688,11 +688,9 @@ def json_list_subscriptions(request, user_profile):
return json_success({"subscriptions": gather_subscriptions(user_profile)})
@authenticated_json_view
def json_remove_subscription(request, user_profile):
if 'subscription' not in request.POST:
return json_error("Missing subscriptions")
sub_name = request.POST.get('subscription')
@has_request_variables
def json_remove_subscription(request, user_profile,
sub_name=POST("subscription")):
stream = get_stream(sub_name, user_profile.realm)
if not stream:
return json_error("Stream does not exist")