invite: Replace invite_as_admin usage with invite_as.

Since we have already added the `invite_as` field to models, we can now
replace usage of `invite_as_admin` properly with its equivalent `invite_as
== PreregistrationUser.INVITE_AS['REALM_ADMIN']`.

Hence, also removed now redundant `invite_as`.
This commit is contained in:
Shubham Dhama
2018-12-30 15:36:12 +05:30
committed by Tim Abbott
parent c9414a3572
commit 42c262b807
9 changed files with 53 additions and 18 deletions

View File

@@ -18,10 +18,10 @@ 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 = $('#invite_as').val();
var invite_as = parseInt($('#invite_as').val(), 10);
var data = {
invitee_emails: $("#invitee_emails").val(),
invite_as_admin: invite_as === 'admin',
invite_as: invite_as,
csrfmiddlewaretoken: $('input[name="csrfmiddlewaretoken"]').attr('value'),
};
var streams = [];