mirror of https://github.com/zulip/zulip.git
invites: Only admins should be able to create multiuse invites.
This commit is contained in:
parent
5069683cad
commit
f0d651f9fe
|
@ -1137,7 +1137,9 @@ class MultiuseInviteTest(ZulipTestCase):
|
|||
|
||||
def test_only_admin_can_create_multiuse_link_api_call(self) -> None:
|
||||
self.login(self.example_email('iago'))
|
||||
self.realm.invite_by_admins_only = True
|
||||
# Only admins should be able to create multiuse invites even if
|
||||
# invite_by_admins_only is set to False.
|
||||
self.realm.invite_by_admins_only = False
|
||||
self.realm.save()
|
||||
|
||||
result = self.client_post('/json/invites/multiuse')
|
||||
|
|
|
@ -101,7 +101,7 @@ def resend_user_invite_email(request: HttpRequest, user_profile: UserProfile,
|
|||
def generate_multiuse_invite_backend(request: HttpRequest, user_profile: UserProfile,
|
||||
stream_ids: List[int]=REQ(validator=check_list(check_int),
|
||||
default=[])) -> HttpResponse:
|
||||
if user_profile.realm.invite_by_admins_only and not user_profile.is_realm_admin:
|
||||
if not user_profile.is_realm_admin:
|
||||
return json_error(_("Must be a realm administrator"))
|
||||
|
||||
streams = []
|
||||
|
|
Loading…
Reference in New Issue