billing: Select the models organization type by default.

Probably in an ideal world, something should make sure these values
are the same.
This commit is contained in:
Tim Abbott 2021-07-18 18:50:41 -07:00
parent d7ef0c7232
commit 9fb5149f78
2 changed files with 7 additions and 2 deletions

View File

@ -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]

View File

@ -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>