From 09ab874642d2366bd31abf8ca8c2190b4ca5299d Mon Sep 17 00:00:00 2001 From: Shubham Dhama Date: Thu, 17 Jan 2019 17:37:40 +0530 Subject: [PATCH] Revert "invite: Fix non-admins inviting new users." This reverts the temporary fix done in commit 46f4e587822de753ebc8047cd68e1309023ed645 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. --- static/js/invite.js | 5 +---- templates/zerver/app/invite_user.html | 4 ++-- zerver/tests/test_templates.py | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/static/js/invite.js b/static/js/invite.js index 9b27a182eb..9dd2f5b3ed 100644 --- a/static/js/invite.js +++ b/static/js/invite.js @@ -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, diff --git a/templates/zerver/app/invite_user.html b/templates/zerver/app/invite_user.html index f3220e348d..e5fccdcaa4 100644 --- a/templates/zerver/app/invite_user.html +++ b/templates/zerver/app/invite_user.html @@ -14,18 +14,18 @@ - {% if is_admin %}
- {% endif %}
{% if development_environment %}
diff --git a/zerver/tests/test_templates.py b/zerver/tests/test_templates.py index 7161a96f2f..0b6bd36091 100644 --- a/zerver/tests/test_templates.py +++ b/zerver/tests/test_templates.py @@ -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)