diff --git a/corporate/urls.py b/corporate/urls.py index 27b7869da6..cbf657eb17 100644 --- a/corporate/urls.py +++ b/corporate/urls.py @@ -22,7 +22,7 @@ v1_api_and_json_patterns = [ url(r'^billing/upgrade$', rest_dispatch, {'POST': 'corporate.views.upgrade'}), url(r'^billing/plan/change$', rest_dispatch, - {'POST': 'corporate.views.change_plan_at_end_of_cycle'}), + {'POST': 'corporate.views.change_plan_status'}), url(r'^billing/sources/change', rest_dispatch, {'POST': 'corporate.views.replace_payment_source'}), ] diff --git a/corporate/views.py b/corporate/views.py index 8c4e7957eb..95459a3d13 100644 --- a/corporate/views.py +++ b/corporate/views.py @@ -203,9 +203,8 @@ def billing_home(request: HttpRequest) -> HttpResponse: @require_billing_access @has_request_variables -def change_plan_at_end_of_cycle(request: HttpRequest, user: UserProfile, - status: int=REQ("status", validator=check_int)) -> HttpResponse: - assert(status in [CustomerPlan.ACTIVE, CustomerPlan.DOWNGRADE_AT_END_OF_CYCLE]) +def change_plan_status(request: HttpRequest, user: UserProfile, + status: int=REQ("status", validator=check_int)) -> HttpResponse: plan = get_current_plan_by_realm(user.realm) assert(plan is not None) # for mypy do_change_plan_status(plan, status)