From aca80206df3d8c21253ca4b23ce8d955440c1025 Mon Sep 17 00:00:00 2001 From: Vishnu KS Date: Thu, 23 Apr 2020 23:32:16 +0530 Subject: [PATCH] billing: Rename change_plan_at_end_of_cycle to change_plan_status. --- corporate/urls.py | 2 +- corporate/views.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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)