Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

sponsorship: Require billing access for sponsorship request.

Aman Agrawalbdf0141b2c4c
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index ad61988ddaf..0a2eb3659ab 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -5496,8 +5496,8 @@ class RequiresBillingAccessTest(StripeTestCase):
)
check_users_cant_access(
- [guest],
- "Must be an organization member",
+ [guest, member],
+ "Insufficient permission",
"/json/billing/sponsorship",
"POST",
{},
diff --git a/corporate/views/sponsorship.py b/corporate/views/sponsorship.py
index 86f49eb4cbb..0f4f269af3d 100644
--- a/corporate/views/sponsorship.py
+++ b/corporate/views/sponsorship.py
@@ -8,7 +8,7 @@ from corporate.lib.decorator import (
authenticated_remote_realm_management_endpoint,
authenticated_remote_server_management_endpoint,
)
-from zerver.decorator import require_organization_member, zulip_login_required
+from zerver.decorator import require_billing_access, zulip_login_required
from zerver.lib.response import json_success
from zerver.models import UserProfile
@@ -67,7 +67,7 @@ def remote_server_sponsorship_page(
return render(request, "corporate/billing/sponsorship.html", context=context)
-@require_organization_member
+@require_billing_access
def sponsorship(
request: HttpRequest,
user: UserProfile,