Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

registration: Fix strict_optional errors.

Anders Kaseorg2fb96e94f1f8
diff --git a/mypy.ini b/mypy.ini
index b2afb32246f..99d361208f0 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 b43db0c25bf..56b366fca00 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),