diff --git a/corporate/migrations/0019_zulipsponsorshiprequest_expected_total_users_and_more.py b/corporate/migrations/0019_zulipsponsorshiprequest_expected_total_users_and_more.py new file mode 100644 index 0000000000..c219cc105e --- /dev/null +++ b/corporate/migrations/0019_zulipsponsorshiprequest_expected_total_users_and_more.py @@ -0,0 +1,27 @@ +# Generated by Django 4.2.6 on 2023-11-11 14:16 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("corporate", "0018_customer_cloud_xor_self_hosted"), + ] + + operations = [ + migrations.AddField( + model_name="zulipsponsorshiprequest", + name="expected_total_users", + field=models.TextField(default=""), + ), + migrations.AddField( + model_name="zulipsponsorshiprequest", + name="paid_users_count", + field=models.TextField(default=""), + ), + migrations.AddField( + model_name="zulipsponsorshiprequest", + name="paid_users_description", + field=models.TextField(default=""), + ), + ] diff --git a/corporate/models.py b/corporate/models.py index b89c5ded74..772b294597 100644 --- a/corporate/models.py +++ b/corporate/models.py @@ -360,3 +360,6 @@ class ZulipSponsorshipRequest(models.Model): org_website = models.URLField(max_length=MAX_ORG_URL_LENGTH, blank=True, null=True) org_description = models.TextField(default="") + expected_total_users = models.TextField(default="") + paid_users_count = models.TextField(default="") + paid_users_description = models.TextField(default="") diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py index bc9e570888..9f64a061e7 100644 --- a/corporate/tests/test_stripe.py +++ b/corporate/tests/test_stripe.py @@ -2159,6 +2159,9 @@ class StripeTest(StripeTestCase): "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", + "paid_users_count": "1 user", + "paid_users_description": "We have 1 paid user.", } response = self.client_post("/json/billing/sponsorship", data) @@ -2172,6 +2175,9 @@ class StripeTest(StripeTestCase): "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", + "paid_users_count": "1 user", + "paid_users_description": "We have 1 paid user.", } response = self.client_post("/json/billing/sponsorship", data) @@ -2223,6 +2229,9 @@ class StripeTest(StripeTestCase): "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", + "paid_users_count": "1 user", + "paid_users_description": "We have 1 paid user.", } response = self.client_post("/json/billing/sponsorship", data) self.assert_json_success(response) diff --git a/corporate/views/upgrade.py b/corporate/views/upgrade.py index 2b1cefbdba..efc784170d 100644 --- a/corporate/views/upgrade.py +++ b/corporate/views/upgrade.py @@ -233,6 +233,9 @@ class SponsorshipRequestForm(forms.Form): website = forms.URLField(max_length=ZulipSponsorshipRequest.MAX_ORG_URL_LENGTH, required=False) organization_type = forms.IntegerField() description = forms.CharField(widget=forms.Textarea) + expected_total_users = forms.CharField(widget=forms.Textarea) + paid_users_count = forms.CharField(widget=forms.Textarea) + paid_users_description = forms.CharField(widget=forms.Textarea, required=False) @require_organization_member @@ -243,6 +246,9 @@ def sponsorship( organization_type: str = REQ("organization-type"), website: str = REQ(), description: str = REQ(), + expected_total_users: str = REQ(), + paid_users_count: str = REQ(), + paid_users_description: str = REQ(), ) -> HttpResponse: realm = user.realm billing_session = RealmBillingSession(user) @@ -266,6 +272,9 @@ def sponsorship( org_website=form.cleaned_data["website"], org_description=form.cleaned_data["description"], org_type=form.cleaned_data["organization_type"], + expected_total_users=form.cleaned_data["expected_total_users"], + paid_users_count=form.cleaned_data["paid_users_count"], + paid_users_description=form.cleaned_data["paid_users_description"], ) sponsorship_request.save() @@ -287,6 +296,9 @@ def sponsorship( "organization_type": org_type_display_name, "website": website, "description": description, + "expected_total_users": expected_total_users, + "paid_users_count": paid_users_count, + "paid_users_description": paid_users_description, } send_email( "zerver/emails/sponsorship_request", diff --git a/templates/corporate/sponsorship.html b/templates/corporate/sponsorship.html index 4ed5396c44..17ef0be1be 100644 --- a/templates/corporate/sponsorship.html +++ b/templates/corporate/sponsorship.html @@ -66,17 +66,35 @@ +