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.

billing: Select the models organization type by default.

Tim Abbott9fb5149f78eb
diff --git a/corporate/views.py b/corporate/views.py
index f0cfc1d1614..d55b1f346f9 100644
--- a/corporate/views.py
+++ b/corporate/views.py
@@ -223,6 +223,7 @@ def initial_upgrade(request: HttpRequest) -> HttpResponse:
"monthly_price": 800,
"percent_off": float(percent_off),
},
+ "realm_org_type": user.realm.org_type,
"sorted_org_types": sorted(
[
[org_type_name, org_type]
diff --git a/templates/corporate/upgrade.html b/templates/corporate/upgrade.html
index c4e8eaa4f34..3a4bfeb4351 100644
--- a/templates/corporate/upgrade.html
+++ b/templates/corporate/upgrade.html
@@ -225,8 +225,12 @@
</label>
<select name="organization-type" required style="width: 100%;" required>
{% for org_type in sorted_org_types %}
- {% if not org_type.hidden %}
- <option data-string-value="{{ org_type[0] }}" value="{{ org_type[1].id }}">{{ _(org_type[1].name) }}</option>
+ {% if not org_type[1].hidden %}
+ <option data-string-value="{{ org_type[0] }}"
+ {% if org_type[1].id == realm_org_type %}selected{% endif %}
+ value="{{ org_type[1].id }}">
+ {{ _(org_type[1].name) }}
+ </option>
{% endif %}
{% endfor %}
</select>