Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
billing: Refactor billing_home to use REQ.
PIG2086a61dc2de208
diff --git a/corporate/views/billing_page.py b/corporate/views/billing_page.pyindex 6fe3482f99f..66ba0270098 100644--- a/corporate/views/billing_page.py+++ b/corporate/views/billing_page.py@@ -34,7 +34,7 @@ from zerver.decorator import require_billing_access, zulip_login_requiredfrom zerver.lib.exceptions import JsonableErrorfrom zerver.lib.request import REQ, has_request_variablesfrom zerver.lib.response import json_success-from zerver.lib.validator import check_int, check_int_in+from zerver.lib.validator import check_bool, check_int, check_int_infrom zerver.models import UserProfilebilling_logger = logging.getLogger("corporate.stripe")@@ -62,7 +62,10 @@ def payment_method_string(stripe_customer: stripe.Customer) -> str:@zulip_login_required-def billing_home(request: HttpRequest) -> HttpResponse:+@has_request_variables+def billing_home(+ request: HttpRequest, onboarding: bool = REQ(default=False, json_validator=check_bool)+) -> HttpResponse:user = request.userassert user.is_authenticated@@ -139,7 +142,7 @@ def billing_home(request: HttpRequest) -> HttpResponse:publishable_key=STRIPE_PUBLISHABLE_KEY,stripe_email=stripe_customer.email,CustomerPlan=CustomerPlan,- onboarding=request.GET.get("onboarding") is not None,+ onboarding=onboarding,)return render(request, "corporate/billing.html", context=context)