From 00cd30ff97eaee11a7216d806f2a66bb8495465a Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 15 Nov 2012 11:36:20 -0500 Subject: [PATCH] Use @has_request_variables in json_remove_subscription. (imported from commit b08b7672959f8773db1ff7e40b53648926b47a09) --- zephyr/views.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zephyr/views.py b/zephyr/views.py index 6a38cfddd4..33c3f46f41 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -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")