mypy: Ensure realm_subdomain is not None in LDAP authenticate().

This commit is contained in:
neiljp (Neil Pilgrim)
2017-08-09 09:04:10 -07:00
committed by Greg Price
parent a6bb8f552b
commit 02acd467b4

View File

@@ -414,7 +414,7 @@ class ZulipLDAPAuthBackend(ZulipLDAPAuthBackendBase):
def authenticate(self, username, password, realm_subdomain=None, return_data=None):
# type: (Text, str, Optional[Text], Optional[Dict[str, Any]]) -> Optional[UserProfile]
try:
if settings.REALMS_HAVE_SUBDOMAINS:
if settings.REALMS_HAVE_SUBDOMAINS and realm_subdomain is not None:
self._realm = get_realm(realm_subdomain)
else:
self._realm = get_realm_by_email_domain(username)