Revert "invite: Fix non-admins inviting new users."

This reverts the temporary fix done in commit
46f4e58782 and replaced it with the fix that
non-admins should be able to see a dropdown to select a non-admin type of
invited user i.e. normal member or guest user.
This commit is contained in:
Shubham Dhama 2019-01-17 17:37:40 +05:30 committed by Tim Abbott
parent fcf2ffe8db
commit 09ab874642
3 changed files with 5 additions and 7 deletions

View File

@ -18,10 +18,7 @@ function submit_invitation_form() {
var invite_status = $('#invite_status');
var invitee_emails = $("#invitee_emails");
var invitee_emails_group = invitee_emails.closest('.control-group');
var invite_as = 1; // Default to Member for non-admins
if (page_params.is_admin) {
invite_as = parseInt($('#invite_as').val(), 10);
}
var invite_as = parseInt($('#invite_as').val(), 10);
var data = {
invitee_emails: $("#invitee_emails").val(),
invite_as: invite_as,

View File

@ -14,18 +14,18 @@
<textarea rows="2" id="invitee_emails" name="invitee_emails" placeholder="{{ _('One or more email addresses...') }}"></textarea>
</div>
</div>
{% if is_admin %}
<div class="control-group">
<label class="control-label" for="invite_as">{{ _('User(s) join as') }}</label>
<div class="controls">
<select id="invite_as">
<option name="invite_as" value="{{ invite_as.MEMBER }}">{{ _('Members') }}</option>
{% if is_admin %}
<option name="invite_as" value="{{ invite_as.REALM_ADMIN }}">{{ _('Organization administrators') }}</option>
{% endif %}
<option name="invite_as" value="{{ invite_as.GUEST_USER }}">{{ _('Guest users') }}</option>
</select>
</div>
</div>
{% endif %}
<div class="alert" id="invite_status"></div>
{% if development_environment %}
<div class="alert" id="dev_env_msg"></div>

View File

@ -206,7 +206,8 @@ class TemplateTestCase(ZulipTestCase):
api_uri_context={},
cloud_annual_price=80,
seat_count=8,
request=RequestFactory().get("/")
request=RequestFactory().get("/"),
invite_as={"MEMBER": 1},
)
context.update(kwargs)