From 2fb96e94f1f86d441db4c1da0b8a21887b5b7ea0 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 4 Jul 2020 17:55:15 -0700 Subject: [PATCH] registration: Fix strict_optional errors. Signed-off-by: Anders Kaseorg --- mypy.ini | 3 --- zerver/views/registration.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/mypy.ini b/mypy.ini index b2afb32246..99d361208f 100644 --- a/mypy.ini +++ b/mypy.ini @@ -40,9 +40,6 @@ strict_optional = True # General exclusions to work on -[mypy-zerver.views.registration] -strict_optional = False - [mypy-tools.lib.html_branches] strict_optional = False diff --git a/zerver/views/registration.py b/zerver/views/registration.py index b43db0c25b..56b366fca0 100644 --- a/zerver/views/registration.py +++ b/zerver/views/registration.py @@ -426,7 +426,7 @@ def accounts_register(request: HttpRequest) -> HttpResponse: 'require_ldap_password': require_ldap_password, 'password_auth_enabled': password_auth_enabled(realm), 'root_domain_available': is_root_domain_available(), - 'default_stream_groups': get_default_stream_groups(realm), + 'default_stream_groups': [] if realm is None else get_default_stream_groups(realm), 'accounts': get_accounts_for_email(email), 'MAX_REALM_NAME_LENGTH': str(Realm.MAX_REALM_NAME_LENGTH), 'MAX_NAME_LENGTH': str(UserProfile.MAX_NAME_LENGTH),