mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
registration: Remove organization type selection in realm creation.
This commit is contained in:
@@ -135,43 +135,6 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group m-10 inline-block">
|
||||
<label for="id_org_type" class="label-title">{{ _('Organization type') }}</label>
|
||||
|
||||
{% for org_type_value, org_type_text in form.realm_org_type.field.choices %}
|
||||
<div class="input-group radio">
|
||||
<input id="id_radio_{{ org_type_value }}" class="required inline-block" type="radio"
|
||||
name="realm_org_type" value="{{ org_type_value }}"
|
||||
{% if org_type_value|string == form.realm_org_type.value()|string %} checked {% endif %} />
|
||||
<label for="id_radio_{{ org_type_value }}" class="inline-block">{{ org_type_text }}</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="m-10">
|
||||
<div class="help-box">
|
||||
<div id="org_type_blob_1" class="blob display-none">
|
||||
{% trans %}
|
||||
Create a corporate organization if your users will be members of the
|
||||
same company, where the privacy expectation is that the company's
|
||||
organization administrators may need to have access to your users'
|
||||
private message history. Zulip features that allow organization
|
||||
administrators to take control of accounts or access private message
|
||||
history for other users are only available to corporate organizations.
|
||||
{% endtrans %}
|
||||
</div>
|
||||
<div id="org_type_blob_2" class="blob">
|
||||
{% trans %}
|
||||
Create a community organization for an open source project, social
|
||||
group, or other community where the privacy expectation is that you
|
||||
and other organization administrators won't have access to your users'
|
||||
private message history. Zulip features that allow organization
|
||||
administrators to take control of accounts or access private message
|
||||
history for other users are disabled in community organizations.
|
||||
{% endtrans %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="input-group margin terms-of-service">
|
||||
@@ -217,10 +180,11 @@ if ($('#id_email').length === 1) {
|
||||
common.autofocus('#id_full_name');
|
||||
}
|
||||
|
||||
$("[name=realm_org_type]").on("change", function () {
|
||||
$(".blob").hide();
|
||||
$("#org_type_blob_" + this.value).show();
|
||||
});
|
||||
// reset error message displays
|
||||
$('#id_team_subdomain_error_client').css('display', 'none');
|
||||
if ($('.team_subdomain_error_server').text() === '') {
|
||||
$('.team_subdomain_error_server').css('display', 'none');
|
||||
}
|
||||
|
||||
$("#timezone").val(moment.tz.guess());
|
||||
</script>
|
||||
|
||||
@@ -58,9 +58,6 @@ class RegistrationForm(forms.Form):
|
||||
password = forms.CharField(widget=forms.PasswordInput, max_length=MAX_PASSWORD_LENGTH,
|
||||
required=False)
|
||||
realm_subdomain = forms.CharField(max_length=Realm.MAX_REALM_SUBDOMAIN_LENGTH, required=False)
|
||||
realm_org_type = forms.ChoiceField(((Realm.COMMUNITY, 'Community'),
|
||||
(Realm.CORPORATE, 'Corporate')),
|
||||
initial=Realm.CORPORATE, required=False)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
# type: (*Any, **Any) -> None
|
||||
|
||||
@@ -281,9 +281,9 @@ class ZulipTestCase(TestCase):
|
||||
return self.submit_reg_form_for_user(email, password)
|
||||
|
||||
def submit_reg_form_for_user(self, email, password, realm_name="Zulip Test",
|
||||
realm_subdomain="zuliptest", realm_org_type=Realm.CORPORATE,
|
||||
realm_subdomain="zuliptest",
|
||||
from_confirmation='', full_name=None, timezone=u'', **kwargs):
|
||||
# type: (Text, Text, Optional[Text], Optional[Text], int, Optional[Text], Optional[Text], Optional[Text], **Any) -> HttpResponse
|
||||
# type: (Text, Text, Optional[Text], Optional[Text], Optional[Text], Optional[Text], Optional[Text], **Any) -> HttpResponse
|
||||
"""
|
||||
Stage two of the two-step registration process.
|
||||
|
||||
@@ -300,7 +300,6 @@ class ZulipTestCase(TestCase):
|
||||
'realm_name': realm_name,
|
||||
'realm_subdomain': realm_subdomain,
|
||||
'key': find_key_by_email(email),
|
||||
'realm_org_type': realm_org_type,
|
||||
'timezone': timezone,
|
||||
'terms': True,
|
||||
'from_confirmation': from_confirmation},
|
||||
|
||||
@@ -1089,7 +1089,6 @@ class UserSignUpTest(ZulipTestCase):
|
||||
'realm_name': 'Zulip Test',
|
||||
'realm_subdomain': 'zuliptest',
|
||||
'key': find_key_by_email(email),
|
||||
'realm_org_type': Realm.CORPORATE,
|
||||
'terms': True})
|
||||
|
||||
# User should now be logged in.
|
||||
@@ -1124,7 +1123,6 @@ class UserSignUpTest(ZulipTestCase):
|
||||
'realm_name': 'Zulip Test',
|
||||
'realm_subdomain': 'zuliptest',
|
||||
'key': find_key_by_email(email),
|
||||
'realm_org_type': Realm.CORPORATE,
|
||||
'terms': True,
|
||||
'from_confirmation': '1'})
|
||||
self.assert_in_success_response(["You're almost there."], result)
|
||||
@@ -1156,7 +1154,6 @@ class UserSignUpTest(ZulipTestCase):
|
||||
'realm_name': 'Zulip Test',
|
||||
'realm_subdomain': 'zuliptest',
|
||||
'key': find_key_by_email(email),
|
||||
'realm_org_type': Realm.CORPORATE,
|
||||
'terms': True,
|
||||
'full_name': "New Guy",
|
||||
'from_confirmation': '1'})
|
||||
@@ -1197,7 +1194,6 @@ class UserSignUpTest(ZulipTestCase):
|
||||
'realm_name': 'Zulip Test',
|
||||
'realm_subdomain': 'zuliptest',
|
||||
'key': find_key_by_email(email),
|
||||
'realm_org_type': Realm.CORPORATE,
|
||||
'terms': True})
|
||||
mock_error.assert_called_once()
|
||||
self.assertEqual(result.status_code, 302)
|
||||
|
||||
@@ -202,8 +202,7 @@ def accounts_register(request):
|
||||
if realm_creation:
|
||||
string_id = form.cleaned_data['realm_subdomain']
|
||||
realm_name = form.cleaned_data['realm_name']
|
||||
org_type = int(form.cleaned_data['realm_org_type'])
|
||||
realm = do_create_realm(string_id, realm_name, org_type=org_type)[0]
|
||||
realm = do_create_realm(string_id, realm_name)[0]
|
||||
|
||||
stream_info = settings.DEFAULT_NEW_REALM_STREAMS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user