mirror of https://github.com/zulip/zulip.git
mypy: Fix strict optional in zerver/views.
This commit is contained in:
parent
55b4a3792d
commit
9ab0a8be6a
|
@ -85,7 +85,7 @@ def redirect_to_subdomain_login_url():
|
||||||
def login_or_register_remote_user(request, remote_username, user_profile, full_name='',
|
def login_or_register_remote_user(request, remote_username, user_profile, full_name='',
|
||||||
invalid_subdomain=False, mobile_flow_otp=None,
|
invalid_subdomain=False, mobile_flow_otp=None,
|
||||||
is_signup=False):
|
is_signup=False):
|
||||||
# type: (HttpRequest, Optional[Text], Optional[UserProfile], Text, bool, Optional[str], bool) -> HttpResponse
|
# type: (HttpRequest, Text, Optional[UserProfile], Text, bool, Optional[str], bool) -> HttpResponse
|
||||||
if invalid_subdomain:
|
if invalid_subdomain:
|
||||||
# Show login page with an error message
|
# Show login page with an error message
|
||||||
return redirect_to_subdomain_login_url()
|
return redirect_to_subdomain_login_url()
|
||||||
|
|
|
@ -81,7 +81,7 @@ def accounts_register(request):
|
||||||
# special URL with domain name so that REALM can be identified if multiple realms exist
|
# special URL with domain name so that REALM can be identified if multiple realms exist
|
||||||
unique_open_realm = get_unique_open_realm()
|
unique_open_realm = get_unique_open_realm()
|
||||||
if unique_open_realm is not None:
|
if unique_open_realm is not None:
|
||||||
realm = unique_open_realm
|
realm = unique_open_realm # type: Optional[Realm]
|
||||||
elif prereg_user.referred_by:
|
elif prereg_user.referred_by:
|
||||||
# If someone invited you, you are joining their realm regardless
|
# If someone invited you, you are joining their realm regardless
|
||||||
# of your e-mail address.
|
# of your e-mail address.
|
||||||
|
@ -196,6 +196,7 @@ def accounts_register(request):
|
||||||
|
|
||||||
create_streams_with_welcome_messages(realm, stream_info)
|
create_streams_with_welcome_messages(realm, stream_info)
|
||||||
set_default_streams(realm, stream_info)
|
set_default_streams(realm, stream_info)
|
||||||
|
assert(realm is not None)
|
||||||
|
|
||||||
full_name = form.cleaned_data['full_name']
|
full_name = form.cleaned_data['full_name']
|
||||||
short_name = email_to_username(email)
|
short_name = email_to_username(email)
|
||||||
|
|
Loading…
Reference in New Issue