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: Use `organization_type` as field name for simplification.

Aman Agrawalcd7893b1bff9
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 7ea5a14ebeb..09bb99363b2 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -1721,7 +1721,7 @@ class StripeTest(StripeTestCase):
user = self.example_user("hamlet")
self.login_user(user)
data = {
- "organization-type": Realm.ORG_TYPES["opensource"]["id"],
+ "organization_type": Realm.ORG_TYPES["opensource"]["id"],
"website": "invalid-url",
"description": "Infinispan is a distributed in-memory key/value data store with optional schema.",
"expected_total_users": "10 users",
@@ -1737,7 +1737,7 @@ class StripeTest(StripeTestCase):
user = self.example_user("hamlet")
self.login_user(user)
data = {
- "organization-type": Realm.ORG_TYPES["opensource"]["id"],
+ "organization_type": Realm.ORG_TYPES["opensource"]["id"],
"website": "",
"description": "Infinispan is a distributed in-memory key/value data store with optional schema.",
"expected_total_users": "10 users",
@@ -1804,7 +1804,7 @@ class StripeTest(StripeTestCase):
self.login_user(user)
data = {
- "organization-type": Realm.ORG_TYPES["opensource"]["id"],
+ "organization_type": Realm.ORG_TYPES["opensource"]["id"],
"website": "https://infinispan.org/",
"description": "Infinispan is a distributed in-memory key/value data store with optional schema.",
"expected_total_users": "10 users",
diff --git a/corporate/views/upgrade.py b/corporate/views/upgrade.py
index 94a982c27da..8a2efa0d1df 100644
--- a/corporate/views/upgrade.py
+++ b/corporate/views/upgrade.py
@@ -144,7 +144,7 @@ class SponsorshipRequestForm(forms.Form):
def sponsorship(
request: HttpRequest,
user: UserProfile,
- organization_type: str = REQ("organization-type"),
+ organization_type: str = REQ(),
website: str = REQ(),
description: str = REQ(),
expected_total_users: str = REQ(),
@@ -159,10 +159,6 @@ def sponsorship(
support_url = get_support_url(realm)
post_data = request.POST.copy()
- # We need to do this because the field name in the template
- # for organization type contains a hyphen and the form expects
- # an underscore.
- post_data.update(organization_type=organization_type)
form = SponsorshipRequestForm(post_data)
if form.is_valid():
diff --git a/templates/corporate/sponsorship.html b/templates/corporate/sponsorship.html
index 1bd46efafe1..29d1cc82abb 100644
--- a/templates/corporate/sponsorship.html
+++ b/templates/corporate/sponsorship.html
@@ -62,7 +62,7 @@
</div>
<div class="input-box sponsorship-form-field">
<div class="inline-block relative">
- <select name="organization-type" id="organization-type" class="sponsorship-form-select">
+ <select name="organization_type" id="organization-type" class="sponsorship-form-select">
{% for org_type in sorted_org_types %}
{% if not org_type[1].hidden %}
<option data-string-value="{{ org_type[0] }}"
@@ -74,7 +74,7 @@
{% endfor %}
</select>
</div>
- <label for="organization-type" class="inline-block label-title">Organization type</label>
+ <label for="organization_type" class="inline-block label-title">Organization type</label>
</div>
<p id="sponsorship-discount-details"></p>
<div class="input-box sponsorship-form-field no-validation">