mirror of https://github.com/zulip/zulip.git
mypy: Use Python 3 type syntax in zerver/views/invite.py.
This commit is contained in:
parent
f07d39353a
commit
2adeaab6ab
|
@ -17,10 +17,10 @@ from zerver.models import PreregistrationUser, Stream, UserProfile
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
def invite_users_backend(request, user_profile,
|
def invite_users_backend(request: HttpRequest, user_profile: UserProfile,
|
||||||
invitee_emails_raw=REQ("invitee_emails"),
|
invitee_emails_raw: str=REQ("invitee_emails"),
|
||||||
invite_as_admin=REQ(validator=check_bool, default=False)):
|
invite_as_admin: Optional[bool]=REQ(validator=check_bool, default=False),
|
||||||
# type: (HttpRequest, UserProfile, str, Optional[bool]) -> HttpResponse
|
) -> HttpResponse:
|
||||||
|
|
||||||
if user_profile.realm.invite_by_admins_only and not user_profile.is_realm_admin:
|
if user_profile.realm.invite_by_admins_only and not user_profile.is_realm_admin:
|
||||||
return json_error(_("Must be a realm administrator"))
|
return json_error(_("Must be a realm administrator"))
|
||||||
|
|
Loading…
Reference in New Issue