invite: Use require_realm_admin decorator.

This commit is contained in:
Tim Abbott 2018-06-16 06:32:59 -07:00
parent 9d827a084d
commit 425b4a3866
1 changed files with 1 additions and 3 deletions

View File

@ -97,13 +97,11 @@ def resend_user_invite_email(request: HttpRequest, user_profile: UserProfile,
timestamp = do_resend_user_invite_email(prereg_user)
return json_success({'timestamp': timestamp})
@require_realm_admin
@has_request_variables
def generate_multiuse_invite_backend(request: HttpRequest, user_profile: UserProfile,
stream_ids: List[int]=REQ(validator=check_list(check_int),
default=[])) -> HttpResponse:
if not user_profile.is_realm_admin:
return json_error(_("Must be an organization administrator"))
streams = []
for stream_id in stream_ids:
try: